7
7
import udapi .block .msf .phrase
8
8
9
9
class Present (udapi .block .msf .phrase .Phrase ):
10
-
10
+
11
11
def process_node (self ,node ):
12
12
# the condition VerbForm == 'Fin' ensures that there are no transgressives between the found verbs
13
-
14
- if node .feats ['Tense' ] == 'Pres' and node .upos == 'VERB' and node .feats ['VerbForm' ] == 'Fin' : #and node.feats['Aspect']=='Imp':
13
+ # the aspect is not always given in Czech treebanks, so we can't rely on the fact that the imperfect aspect is specified
14
+ if node .feats ['Tense' ] == 'Pres' and node .upos == 'VERB' and node .feats ['VerbForm' ] == 'Fin' : #and node.feats['Aspect']=='Imp':
15
15
refl = [x for x in node .children if x .feats ['Reflex' ] == 'Yes' and x .udeprel == 'expl' ]
16
16
neg = [x for x in node .children if x .feats ['Polarity' ] == 'Neg' and x .upos == 'PART' ]
17
17
aux_forb = [x for x in node .children if x .upos == 'AUX' and (x .lemma == 'ќе' or x .lemma == 'ще' or x .feats ['Mood' ] == 'Cnd' )] # forbidden auxiliaries for present tense (these auxiliaries are used for the future tense or the conditional mood)
@@ -33,7 +33,6 @@ def process_node(self,node):
33
33
ords = phrase_ords
34
34
)
35
35
return
36
-
37
36
38
37
# passive voice
39
38
if node .upos == 'ADJ' and node .feats ['Voice' ] == 'Pass' :
@@ -61,9 +60,33 @@ def process_node(self,node):
61
60
animacy = node .feats ['Animacy' ]
62
61
)
63
62
return
63
+
64
+ # participles
65
+ # in some languages, participles are used as attributes (they express case and degree)
66
+ if node .upos == 'ADJ' and node .feats ['VerbForm' ] == 'Part' :
67
+ aux_forb = [x for x in node .children if x .udeprel == 'aux' ]
68
+ cop = [x for x in node .children if x .udeprel == 'cop' ]
69
+
70
+ if not aux_forb and not cop :
71
+ refl = [x for x in node .children if x .feats ['Reflex' ] == 'Yes' and x .udeprel == 'expl' ]
72
+ neg = [x for x in node .children if x .feats ['Polarity' ] == 'Neg' and x .upos == 'PART' ]
73
+ phrase_ords = [node .ord ] + [x .ord for x in refl ] + [x .ord for x in neg ]
74
+ phrase_ords .sort ()
75
+
76
+ self .write_node_info (node ,
77
+ aspect = node .feats ['Aspect' ],
78
+ tense = node .feats ['Tense' ],
79
+ number = node .feats ['Number' ],
80
+ form = 'Part' ,
81
+ voice = self .get_voice (node , refl ),
82
+ reflex = self .get_is_reflex (node , refl ),
83
+ polarity = self .get_polarity (node ,neg ),
84
+ ords = phrase_ords
85
+ )
86
+ return
64
87
65
- cop = [x for x in node .children if x .udeprel == " cop" and x .feats ['Tense' ] == " Pres" ]
66
- aux = [x for x in node .children if x .udeprel == "aux" and x .feats ['Mood' ] == " Ind" and x .feats ['Tense' ] == 'Pres' ]
88
+ cop = [x for x in node .children if x .udeprel == ' cop' and x .feats ['Tense' ] == ' Pres' ]
89
+ aux = [x for x in node .children if x .udeprel == "aux" and x .feats ['Mood' ] == ' Ind' and x .feats ['Tense' ] == 'Pres' ]
67
90
aux_forb = [x for x in node .children if x .upos == 'AUX' and x .feats ['Tense' ] != 'Pres' ] # in Serbian this can be a future tense
68
91
prep = [x for x in node .children if x .upos == 'ADP' ]
69
92
neg = [x for x in node .children if x .feats ['Polarity' ] == 'Neg' and x .upos == 'PART' ]
@@ -76,10 +99,10 @@ def process_node(self,node):
76
99
phrase_ords .sort ()
77
100
78
101
self .write_node_info (node ,
102
+ aspect = copVerb .feats ['Aspect' ],
79
103
tense = 'Pres' ,
80
104
person = copVerb .feats ['Person' ],
81
105
number = copVerb .feats ['Number' ],
82
- aspect = node .feats ['Aspect' ],
83
106
mood = 'Ind' ,
84
107
form = 'Fin' ,
85
108
voice = self .get_voice (copVerb , refl ),
0 commit comments