Skip to content

Commit c6465a5

Browse files
committed
Abbr=Yes in ml.
1 parent 1ddfce4 commit c6465a5

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

udapi/block/ud/ml/markfeatsbugs.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def process_node(self, node):
2929
'Animacy': ['Anim', 'Inan'],
3030
'Number': ['Sing', 'Plur'],
3131
'Case': ['Nom', 'Gen', 'Dat', 'Ben', 'Acc', 'Voc', 'Loc', 'Abl', 'Ins', 'Cmp', 'Com', 'All'],
32+
'Abbr': ['Yes'],
3233
'Foreign': ['Yes'],
3334
'Typo': ['Yes']})
3435
# ADJECTIVES ###########################################################
3536
elif node.upos == 'ADJ':
3637
self.check_allowed_features(node, {
3738
'VerbForm': ['Part'],
39+
'Abbr': ['Yes'],
3840
'Foreign': ['Yes'],
3941
'Typo': ['Yes']})
4042
# PRONOUNS #############################################################
@@ -43,6 +45,7 @@ def process_node(self, node):
4345
af = {
4446
'PronType': ['Prs', 'Int', 'Ind'], # demonstrative pronouns are treated as third person personal pronouns
4547
'Case': ['Nom', 'Gen', 'Dat', 'Ben', 'Acc', 'Voc', 'Loc', 'Abl', 'Ins', 'Cmp', 'Com', 'All'],
48+
'Abbr': ['Yes'],
4649
'Typo': ['Yes']
4750
}
4851
if node.feats['PronType'] == 'Prs':
@@ -88,13 +91,15 @@ def process_node(self, node):
8891
self.check_allowed_features(node, {
8992
'PronType': ['Art'],
9093
'Definite': ['Ind'],
94+
'Abbr': ['Yes'],
9195
'Typo': ['Yes']
9296
})
9397
else:
9498
self.check_required_features(node, ['PronType'])
9599
self.check_allowed_features(node, {
96100
'PronType': ['Dem', 'Int', 'Rel', 'Ind', 'Neg', 'Tot'],
97101
'Deixis': ['Prox', 'Remt'],
102+
'Abbr': ['Yes'],
98103
'Typo': ['Yes']
99104
})
100105
# NUMERALS #############################################################
@@ -105,6 +110,7 @@ def process_node(self, node):
105110
self.check_allowed_features(node, {
106111
'NumType': ['Card'],
107112
'NumForm': ['Digit', 'Roman'],
113+
'Abbr': ['Yes'],
108114
'Typo': ['Yes']
109115
})
110116
else:
@@ -114,6 +120,7 @@ def process_node(self, node):
114120
'NumForm': ['Word'],
115121
'Number': ['Plur'],
116122
'Case': ['Nom', 'Gen', 'Dat', 'Ben', 'Acc', 'Voc', 'Loc', 'Abl', 'Ins', 'Cmp', 'Com', 'All'],
123+
'Abbr': ['Yes'],
117124
'Typo': ['Yes']
118125
})
119126
# VERBS ################################################################
@@ -125,6 +132,7 @@ def process_node(self, node):
125132
'Polarity': ['Pos', 'Neg'],
126133
'Voice': ['Act', 'Pass', 'Cau'],
127134
'Foreign': ['Yes'],
135+
'Abbr': ['Yes'],
128136
'Typo': ['Yes']
129137
})
130138
elif node.feats['VerbForm'] == 'Fin':
@@ -140,6 +148,7 @@ def process_node(self, node):
140148
'Mood': ['Imp'],
141149
'Polarity': ['Pos', 'Neg'],
142150
'Polite': ['Infm', 'Form'],
151+
'Abbr': ['Yes'],
143152
'Foreign': ['Yes'],
144153
'Typo': ['Yes']
145154
})
@@ -151,6 +160,7 @@ def process_node(self, node):
151160
'Mood': ['Nec'],
152161
'Polarity': ['Pos', 'Neg'],
153162
'Voice': ['Act', 'Pass', 'Cau'],
163+
'Abbr': ['Yes'],
154164
'Foreign': ['Yes'],
155165
'Typo': ['Yes']
156166
})
@@ -163,6 +173,7 @@ def process_node(self, node):
163173
'Tense': ['Past', 'Imp', 'Pres', 'Fut'], # only in indicative
164174
'Polarity': ['Pos', 'Neg'],
165175
'Voice': ['Act', 'Pass', 'Cau'],
176+
'Abbr': ['Yes'],
166177
'Foreign': ['Yes'],
167178
'Typo': ['Yes']
168179
})
@@ -174,6 +185,7 @@ def process_node(self, node):
174185
'Tense': ['Past'],
175186
'Polarity': ['Pos', 'Neg'],
176187
'Voice': ['Act', 'Pass', 'Cau'],
188+
'Abbr': ['Yes'],
177189
'Foreign': ['Yes'],
178190
'Typo': ['Yes']
179191
})
@@ -190,6 +202,7 @@ def process_node(self, node):
190202
'Voice': ['Act', 'Pass', 'Cau'],
191203
# We only annotate case of verbal nouns if it is not Nom, i.e., there is an actual case suffix.
192204
'Case': ['Gen', 'Dat', 'Ben', 'Acc', 'Voc', 'Loc', 'Abl', 'Ins', 'Cmp', 'Com', 'All'],
205+
'Abbr': ['Yes'],
193206
'Foreign': ['Yes'],
194207
'Typo': ['Yes']
195208
})
@@ -204,6 +217,7 @@ def process_node(self, node):
204217
'VerbForm': ['Fin'],
205218
'Mood': ['Imp'],
206219
'Polarity': ['Pos', 'Neg'],
220+
'Abbr': ['Yes'],
207221
'Typo': ['Yes']
208222
})
209223
else: # indicative or subjunctive
@@ -214,6 +228,7 @@ def process_node(self, node):
214228
'Mood': ['Ind', 'Sub', 'Cnd'],
215229
'Tense': ['Past', 'Imp', 'Pres', 'Fut'], # only in indicative
216230
'Polarity': ['Pos', 'Neg'],
231+
'Abbr': ['Yes'],
217232
'Typo': ['Yes']
218233
})
219234
else: # verbal noun
@@ -228,6 +243,7 @@ def process_node(self, node):
228243
'Polarity': ['Pos', 'Neg'],
229244
# We only annotate case of verbal nouns if it is not Nom, i.e., there is an actual case suffix.
230245
'Case': ['Gen', 'Dat', 'Ben', 'Acc', 'Voc', 'Loc', 'Abl', 'Ins', 'Cmp', 'Com', 'All'],
246+
'Abbr': ['Yes'],
231247
'Typo': ['Yes']
232248
})
233249
# ADVERBS ##############################################################
@@ -248,13 +264,15 @@ def process_node(self, node):
248264
# Case suffixes after numbers are separate tokens, they are attached
249265
# via the 'case' relation and they bear the Case feature (the number does not).
250266
'Case': ['Gen', 'Dat', 'Ben', 'Acc', 'Voc', 'Loc', 'Abl', 'Ins', 'Cmp', 'Com', 'All'],
267+
'Abbr': ['Yes'],
251268
'Typo': ['Yes']})
252269
# PARTICLES ############################################################
253270
elif node.upos == 'PART':
254271
self.check_allowed_features(node, {
255272
'Polarity': ['Neg'],
273+
'Abbr': ['Yes'],
256274
'Typo': ['Yes']
257275
})
258276
# THE REST: NO FEATURES ################################################
259277
else:
260-
self.check_allowed_features(node, {'Typo': ['Yes']})
278+
self.check_allowed_features(node, {'Abbr': ['Yes'], 'Typo': ['Yes']})

0 commit comments

Comments
 (0)