Skip to content

Instantly share code, notes, and snippets.

@bguil
Created February 13, 2021 09:20
Show Gist options
  • Save bguil/dcb312f64250a98bb23db544bfabcc12 to your computer and use it in GitHub Desktop.
Save bguil/dcb312f64250a98bb23db544bfabcc12 to your computer and use it in GitHub Desktop.
GRS for French auxiliary correction
% GRS system to convert French verb "pouvoir", "devoir", "vouloir" and "aller" when they introduce a completive
% They were considered as AUX previously, but are now plain VERB in all French corpora
% In all rules above, the "without" clause with "AUX2" node is there to ensure that the outermost aux is considered first.
% This is needed in case of multiple tranformation. Ex: `fr_partut-ud-851` "…la mère peut aller se reproduire…"
% Move negative adverbs on the old AUX
rule neg {
pattern {
AUX[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V[upos=VERB]; V -[aux]-> AUX;
e: V -[advmod]-> NEG; NEG[lemma=ne|pas|plus];
}
without {
AUX2[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V -[aux]-> AUX2;
AUX2 << AUX;
}
commands {
del_edge e;
add_edge AUX -[advmod]-> NEG;
}
}
% Move other complement on the old AUX, if they are on the left
rule left {
pattern {
AUX[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V[upos=VERB]; V -[aux]-> AUX;
e: V -[advmod|obl|advcl|nummod|punct]-> X; X << AUX;
}
without {
AUX2[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V -[aux]-> AUX2;
AUX2 << AUX;
}
commands {
add_edge f: AUX -> X;
f.label = e.label;
del_edge e;
}
}
% Move final punct on the old AUX
rule dot {
pattern {
AUX[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V[upos=VERB]; V -[aux]-> AUX;
e: V -[punct]-> X;
}
without {
AUX2[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V -[aux]-> AUX2;
AUX2 << AUX;
}
without { Y[]; X<Y } % final punct
commands {
del_edge e;
add_edge AUX -[punct]-> X;
}
}
% change aux into xcomp in the other direction
rule aux {
pattern {
AUX[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V[upos=VERB]; V -[aux]-> AUX;
}
without {
AUX2[upos=AUX, lemma=pouvoir|devoir|vouloir|aller];
V -[aux]-> AUX2;
AUX2 << AUX;
}
commands {
del_edge V -[aux]-> AUX;
shift_in V ==> AUX;
shift_out V =[root|mark|cc|vocative]=> AUX;
shift_out V =[1=nsubj]=> AUX;
add_edge AUX -[xcomp]-> V;
AUX.upos=VERB;
}
}
strat main {
Seq (
Iter (neg),
Iter (left),
Iter (dot),
Iter (aux)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment