Dropping relation information
We are trying to convert a treebank.
Input:
# sent_id = DW-s2
# text[seg] = Wiñarqu -y -manta -wan miryukuna -manta -wan
1 Wiñarqu _ VERB Root _ 3 s.arg _ Gloss=desarollar,crecer
2 -y _ NS NS VerbForm=Inf 1 ns _ _
3 -manta _ Cas Cas Case=Abl 6 @conj _ _
4 -wan _ Cas Cas Case=Ins 3 s.co _ _
5 miryukuna _ NUM Root Number=Plur 6 s.arg _ _
6 -manta _ Cas Cas Case=Abl 0 sntc _ _
7 -wan _ Cas Cas Case=Ins 6 s.co _ _
grs:
rule mergens {
pattern {
V [xpos=Root];
NS [upos=NS];
V -[ns]-> NS;
}
commands {
V.form = V.form + NS.form;
V.VerbForm = NS.VerbForm;
del_node NS;
}
}
rule cas {
pattern {
R [xpos=Root];
C [upos=Cas];
C -[s.arg]-> R;
}
commands{
R.form = R.form + C.form;
R.Case = C.Case;
del_node C
}
}
strat main { Seq (Onf(mergens), Onf(cas)) }
Output:
# sent_id = DW-s2
# text[seg] = Wiñarqu -y -manta -wan miryukuna -manta -wan
1 Wiñarqu-y-manta _ VERB Root Case=Abl|VerbForm=Inf _ _ _ Gloss=desarollar,crecer
2 -wan _ Cas Cas Case=Ins _ _ _ _
3 miryukuna-manta _ NUM Root Case=Abl|Number=Plur _ _ _ _
4 -wan _ Cas Cas Case=Ins _ _ _ _
As you can see, the head and relation information is lost. Is there a way to preserve or update this information in my commands?