Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fc180b9

Browse files
Updated Slavic present tense.
1 parent e321d4d commit fc180b9

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

‎udapi/block/msf/slavic/present.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import udapi.block.msf.phrase
88

99
class Present(udapi.block.msf.phrase.Phrase):
10-
10+
1111
def process_node(self,node):
1212
# 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':
1515
refl = [x for x in node.children if x.feats['Reflex'] == 'Yes' and x.udeprel == 'expl']
1616
neg = [x for x in node.children if x.feats['Polarity'] == 'Neg' and x.upos == 'PART']
1717
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):
3333
ords=phrase_ords
3434
)
3535
return
36-
3736

3837
# passive voice
3938
if node.upos == 'ADJ' and node.feats['Voice'] == 'Pass':
@@ -61,9 +60,33 @@ def process_node(self,node):
6160
animacy=node.feats['Animacy']
6261
)
6362
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
6487

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']
6790
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
6891
prep = [x for x in node.children if x.upos == 'ADP']
6992
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):
7699
phrase_ords.sort()
77100

78101
self.write_node_info(node,
102+
aspect=copVerb.feats['Aspect'],
79103
tense='Pres',
80104
person=copVerb.feats['Person'],
81105
number=copVerb.feats['Number'],
82-
aspect=node.feats['Aspect'],
83106
mood='Ind',
84107
form='Fin',
85108
voice=self.get_voice(copVerb, refl),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /