Talk:Dependency based re-ordering

From Apertium
Jump to navigation Jump to search

Example in VISLCG3

Some of this stuff can be done in VISLCG3, with the MOVE command:

Input

"<Í>"
        "í" Pr @ADVL→ #1->3 
"<upphavi>"
        "upphav" N Neu Sg Dat Indef @P← #2->1 
"<skapti>"
        "skapa" V Ind Prt Sg @VMAIN #3->0 
"<Gud>"
        "gudur" N Msc Sg Nom Indef @←SUBJ #4->3 
"<himmal>"
        "himmal" N Msc Sg Acc Indef @←OBJ #5->3 
"<og>"
        "og" CC @CC #6->5 
"<jørð>"
        "jørð" N Fem Sg Acc Indef @←OBJ #7->5
"<.>"
        "." CLB #8->0 

Rule

$ cat /tmp/cg
SECTION

MOVE WITHCHILD (*) (@←OBJ) BEFORE (-1* (@VMAIN)) ;

Output

$ cat /tmp/in | vislcg3 --grammar /tmp/cg
VISL CG-3 Disambiguator version 0.9.7.6785
Codepage: default UTF-8, input UTF-8, output UTF-8, grammar UTF-8
Parsing grammar took 0 seconds.
Grammar has 1 sections, 0 templates, 1 rules, 3 sets, 0 c-tags, 8 s-tags.
Grammar has dependency rules.
Warning: No soft or hard delimiters defined in grammar. Hard limit of 500 cohorts may break windows in unintended places.
"<Í>"
	"í" Pr @ADVL→ #1->6 
"<upphavi>"
	"upphav" N Neu Sg Dat Indef @P← #2->1 
"<himmal>"
	"himmal" N Msc Sg Acc Indef @←OBJ #3->6 
"<og>"
	"og" CC @CC #4->3 
"<jørð>"
	"jørð" N Fem Sg Acc Indef @←OBJ #5->3 
"<skapti>"
	"skapa" V Ind Prt Sg @VMAIN #6->0 
"<Gud>"
	"gudur" N Msc Sg Nom Indef @←SUBJ #7->6 
"<.>"
	"." CLB #8->0