Skip to content

Instantly share code, notes, and snippets.

View bguil's full-sized avatar

Bruno Guillaume bguil

  • Inria
  • Nancy, France
View GitHub Profile
{
"META": [
"sent_id",
"text",
"text_en",
"text_ortho",
"speaker_id",
"sound_url"
],
"UPOS": [
# sent_id = en_partut-ud-1610
# text = they were unimpressed.
1 they they PRON PE Number=Plur|Person=3|PronType=Prs 3 nsubj _ _
2 were be AUX V Mood=Ind|Number=Plur|Tense=Past|VerbForm=Fin 3 cop _ _
3 unimpressed unimpressed ADJ A Degree=Pos 0 root _ SpaceAfter=No
4 . . PUNCT FS _ 3 punct _ _
@bguil
bguil / amal.grs
Last active September 27, 2021 08:53
Test remove amalgam
rule r {
pattern {
N1 [];
N2 [textform="_"];
N1 < N2;
N1 -> N2;
}
commands {
N1.form = N1.textform;
del_node N2;
rule det_N-Det{
pattern{
N[upos=NOUN];
Det[upos=DET, PronType=DEM];
%Det << N;
e: N-[det]->Det;
e.length = 2
}
commands{
add_edge f: N->Det;
@bguil
bguil / aux.grs
Created February 13, 2021 09:20
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];
@bguil
bguil / gist:b566e405995ca568adb0f659887bb6b9
Created October 5, 2020 13:58
Grew GRS (Version 1.4) for changing old SUD annotation 'EXTPOS + @fixed' into 'ExtPos + InIdiom=Yes'
package fixed2idiom {
rule EXTPOS {
pattern { N[EXTPOS] }
commands {
N.ExtPos = N.EXTPOS;
del_feat N.EXTPOS;
N.PhraseType = Idiom;
}
}
@bguil
bguil / gist:237776a525331a8bc39caf44c0d6677a
Created September 25, 2020 12:22
Grew GRS for changing old SUD annotation 'EXTPOS + @fixed' into 'ExtPos + InIdiom=Yes'
package fixed2idiom {
rule _MISC_EXTPOS {
pattern { N[_MISC_EXTPOS] }
commands {
N._MISC_ExtPos = N._MISC_EXTPOS;
del_feat N._MISC_EXTPOS;
N._MISC_PhraseType = Idiom;
}
}