77class Conditional (udapi .block .mwe .msfphrase .MsfPhrase ):
88
99 def process_node (self , node ):
10- if node .feats ['VerbForm' ] == 'Part' or node .feats ['VerbForm' ] == 'Fin' :
10+ if ( node .feats ['VerbForm' ] == 'Part' or node . feats [ 'VerbForm' ] == 'PartRes' ) or node .feats ['VerbForm' ] == 'Fin' :
1111 # in most Slavic languages, the verb has feats['VerbForm'] == 'Part' but in Polish the verb has feats['VerbForm'] == 'Fin'
1212
1313 aux_cnd = [x for x in node .children if x .feats ['Mood' ] == 'Cnd' or x .deprel == 'aux:cnd' ] # list for auxiliary verbs for forming the conditional mood
@@ -19,18 +19,19 @@ def process_node(self, node):
1919
2020 if len (aux_cnd ) > 0 and len (cop ) == 0 :
2121 aux = [x for x in node .children if x .udeprel == 'aux' or x .feats ['Mood' ] == 'Cnd' ] # all auxiliary verbs and conjuctions with feats['Mood'] == 'Cnd'
22- refl = [x for x in node .children if x .feats ['Reflex' ] == 'Yes' ]
22+ refl = [x for x in node .children if x .feats ['Reflex' ] == 'Yes' and x . udeprel == 'expl' ]
2323 neg = [x for x in node .children if x .feats ['Polarity' ] == 'Neg' and x .upos == 'PART' ]
2424
2525 phrase_ords = [node .ord ] + [x .ord for x in aux ] + [x .ord for x in refl ] + [x .ord for x in neg ]
2626 phrase_ords .sort ()
2727
2828 auxVerb = aux_cnd [0 ]
2929
30- person = '3' # TODO there could be a problem in russian etc. (same as in past tense)
30+ person = '3' # TODO there is a problem in russian etc. (same as in past tense)
3131 if auxVerb .feats ['Person' ] != '' :
3232 person = auxVerb .feats ['Person' ]
3333
34+
3435 self .write_node_info (node ,
3536 person = person ,
3637 number = node .feats ['Number' ],
@@ -45,29 +46,31 @@ def process_node(self, node):
4546 animacy = node .feats ['Animacy' ]
4647 )
4748 return
49+
4850
4951 cop = [x for x in node .children if x .udeprel == 'cop' and (x .feats ['VerbForm' ] == 'Part' or x .feats ['VerbForm' ] == 'Fin' )]
50- aux_cnd = [x for x in node .children if x .feats ['Mood' ] == 'Cnd' or x .deprel == 'aux:pass ' ]
52+ aux_cnd = [x for x in node .children if x .feats ['Mood' ] == 'Cnd' or x .deprel == 'aux:cnd ' ]
5153
5254 if len (cop ) > 0 and len (aux_cnd ) > 0 :
53- aux = [x for x in node .children if x .udeprel == 'aux' or x .feats ['Mood' ] == 'Cnd' ]
55+ # there can be a copula with Mood='Cnd' (i. e. in Old East Slavonic), we don't want to count these copula in phrase_ords twice, so there is x.udeprel != 'cop' in aux list
56+ aux = [x for x in node .children if (x .udeprel == 'aux' or x .feats ['Mood' ] == 'Cnd' ) and x .udeprel != 'cop' ]
5457 neg = [x for x in node .children if x .feats ['Polarity' ] == 'Neg' and x .upos == 'PART' ]
5558 prep = [x for x in node .children if x .upos == 'ADP' ]
56- refl = [x for x in node .children if x .feats ['Reflex' ] == 'Yes' ]
59+ refl = [x for x in node .children if x .feats ['Reflex' ] == 'Yes' and x . udeprel == 'expl' ]
5760
5861 copVerb = cop [0 ]
5962 phrase_ords = [node .ord ] + [x .ord for x in aux ] + [x .ord for x in cop ] + [x .ord for x in neg ] + [x .ord for x in prep ] + [x .ord for x in refl ]
6063 phrase_ords .sort ()
6164 self .write_node_info (node ,
65+ aspect = copVerb .feats ['Aspect' ],
6266 person = copVerb .feats ['Person' ],
6367 number = copVerb .feats ['Number' ],
6468 mood = 'Cnd' ,
6569 form = 'Fin' ,
66- voice = self .get_voice (node , refl ),
70+ voice = self .get_voice (copVerb , refl ),
6771 polarity = self .get_polarity (copVerb ,neg ),
6872 reflex = self .get_is_reflex (node , refl ),
6973 ords = phrase_ords ,
7074 gender = copVerb .feats ['Gender' ],
7175 animacy = copVerb .feats ['Animacy' ]
7276 )
73-
0 commit comments