@@ -29,7 +29,7 @@ def process_node(self, node):
29
29
af = {}
30
30
# NOUNS ################################################################
31
31
if node .upos == 'NOUN' :
32
- if not node .feats ['Abbr' ] == 'Yes' :
32
+ if not node .feats ['Abbr' ] == 'Yes' or node . feats [ 'Case' ]: # abbreviated or indeclinable nouns
33
33
rf = ['Gender' , 'Number' , 'Case' ]
34
34
af = {
35
35
'Gender' : ['Masc' , 'Fem' , 'Neut' ],
@@ -41,61 +41,71 @@ def process_node(self, node):
41
41
if self .flavio :
42
42
# Flavio added InflClass but not everywhere, so it is not required.
43
43
af ['InflClass' ] = ['IndEurA' , 'IndEurE' , 'IndEurI' , 'IndEurO' , 'IndEurU' , 'IndEurX' ]
44
+ af ['VerbForm' ] = ['Part' ]
45
+ af ['Proper' ] = ['Yes' ]
46
+ af ['Compound' ] = ['Yes' ]
47
+ af ['NameType' ] = ['Ast' , 'Cal' , 'Com' , 'Geo' , 'Giv' , 'Let' , 'Lit' , 'Met' , 'Nat' , 'Rel' , 'Sur' , 'Oth' ]
44
48
self .check_required_features (node , rf )
45
49
self .check_allowed_features (node , af )
46
50
# PROPER NOUNS #########################################################
47
51
elif node .upos == 'PROPN' :
48
- if not node .feats ['Abbr' ] == 'Yes' :
52
+ if not node .feats ['Abbr' ] == 'Yes' and node . feats [ 'Case' ]: # abbreviated and indeclinable nouns
49
53
rf = ['Gender' , 'Number' , 'Case' ]
50
54
af = {
51
55
'Gender' : ['Masc' , 'Fem' , 'Neut' ],
52
56
'Number' : ['Sing' , 'Plur' ],
53
57
'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ],
54
- 'NameType' : ['Giv' , 'Sur' , 'Geo' ],
55
58
'Abbr' : ['Yes' ],
56
59
'Foreign' : ['Yes' ]}
57
60
if self .flavio :
58
- # Flavio added InflClass but not everywhere, so it is not required.
59
- af ['InflClass' ] = ['IndEurA' , 'IndEurE' , 'IndEurI' , 'IndEurO' , 'IndEurU' , 'IndEurX' ]
60
- af ['Proper' ] = ['Yes' ]
61
+ af ['Compound' ] = 'Yes'
62
+ af ['NameType' ] = ['Ast' , 'Cal' , 'Com' , 'Geo' , 'Giv' , 'Let' , 'Lit' , 'Met' , 'Nat' , 'Rel' , 'Sur' , 'Oth' ]
63
+ if not node .feats ['Abbr' ] == 'Yes' and node .feats ['Case' ]:
64
+ af ['InflClass' ] = ['IndEurA' , 'IndEurE' , 'IndEurI' , 'IndEurO' , 'IndEurU' , 'IndEurX' ]
61
65
self .check_required_features (node , rf )
62
66
self .check_allowed_features (node , af )
63
67
# ADJECTIVES ###########################################################
64
68
elif node .upos == 'ADJ' :
65
- if not node .feats ['Abbr' ] == 'Yes' :
66
- rf = ['Gender' , 'Number' , 'Case' , 'Degree' ]
69
+ if not node .feats ['Abbr' ] == 'Yes' and node . feats [ 'Case' ] :
70
+ rf = ['Gender' , 'Number' , 'Case' ]
67
71
af = {
68
72
'NumType' : ['Ord' , 'Dist' ],
69
73
'Gender' : ['Masc' , 'Fem' , 'Neut' ],
70
74
'Number' : ['Sing' , 'Plur' ],
71
75
'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ],
72
- 'Degree' : ['Pos' , ' Cmp' , 'Sup' , 'Abs' ],
76
+ 'Degree' : ['Cmp' , 'Sup' , 'Abs' ],
73
77
'Abbr' : ['Yes' ],
74
- 'Foreign' : ['Yes' ]}
78
+ 'Foreign' : ['Yes' ],
79
+ 'Polarity' : ['Neg' ]}
75
80
if self .flavio :
76
81
# Flavio does not use Degree=Pos, hence Degree is not required.
77
- rf = [f for f in rf if f != 'Degree' ]
82
+ # rf = [f for f in rf if f != 'Degree']
78
83
# Flavio added InflClass but not everywhere, so it is not required.
79
84
af ['InflClass' ] = ['IndEurA' , 'IndEurE' , 'IndEurI' , 'IndEurO' , 'IndEurU' , 'IndEurX' ]
80
85
af ['Compound' ] = ['Yes' ]
86
+ af ['VerbForm' ] = ['Part' ]
81
87
af ['Proper' ] = ['Yes' ]
88
+ af ['Degree' ].append ('Dim' )
89
+ af ['NameType' ] = ['Ast' , 'Cal' , 'Com' , 'Geo' , 'Giv' , 'Let' , 'Lit' , 'Met' , 'Nat' , 'Rel' , 'Sur' , 'Oth' ]
82
90
self .check_required_features (node , rf )
83
91
self .check_allowed_features (node , af )
84
92
# PRONOUNS #############################################################
85
93
elif node .upos == 'PRON' :
86
94
rf = ['PronType' , 'Case' ]
87
95
af = {
88
- 'PronType' : ['Prs' , 'Rel' , 'Ind' ],
96
+ 'PronType' : ['Prs' , 'Rel' , 'Ind' , 'Int' , 'Rcp' ],
89
97
'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ]
90
98
}
91
99
if node .feats ['PronType' ] == 'Prs' :
92
100
af ['Reflex' ] = ['Yes' ]
93
101
if node .feats ['Reflex' ] == 'Yes' : # seipsum, se
102
+ rf .extend (['Person' ])
94
103
# seipsum has gender and number but se does not, so it is not required
95
- af ['Gender' ] = ['Masc' ]
96
- af ['Number' ] = ['Sing' ]
104
+ # TODO: seipsum in ITTB, but why lemma seipsum instead of seipse?
105
+ af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
106
+ af ['Number' ] = ['Sing' , 'Plur' ]
97
107
af ['Person' ] = ['3' ]
98
- af ['Case' ] = ['Gen' , 'Dat' , 'Acc' , 'Loc' , 'Abl' ]
108
+ af ['Case' ] = ['Nom' , ' Gen' , 'Dat' , 'Acc' , 'Loc' , 'Abl' ]
99
109
else : # not reflexive: ego, tu, is, nos
100
110
rf .extend (['Person' , 'Number' ])
101
111
af ['Person' ] = ['1' , '2' , '3' ]
@@ -104,22 +114,34 @@ def process_node(self, node):
104
114
if node .feats ['Person' ] == '3' : # is, id
105
115
rf .append ('Gender' )
106
116
af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
107
- elif re .match (r'^(Rel|Ind )$' , node .feats ['PronType' ]):
117
+ elif re .match (r'^(Rel|Int )$' , node .feats ['PronType' ]):
108
118
rf .extend (['Gender' , 'Number' ])
109
119
af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
110
120
af ['Number' ] = ['Sing' , 'Plur' ]
121
+ elif node .feats ['PronType' ] == 'Ind' :
122
+ rf = [f for f in rf if f != 'Case' ]
123
+ af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
124
+ af ['Number' ] = ['Sing' , 'Plur' ]
111
125
if self .flavio :
112
126
# Flavio added InflClass but not everywhere, so it is not required.
113
127
af ['InflClass' ] = ['LatAnom' , 'LatPron' ]
128
+ af ['Compound' ] = ['Yes' ]
129
+ af ['Polarity' ] = ['Neg' ]
130
+ af ['Form' ] = ['Emp' ]
114
131
self .check_required_features (node , rf )
115
132
self .check_allowed_features (node , af )
116
133
# DETERMINERS ##########################################################
117
134
elif node .upos == 'DET' :
118
- rf = ['PronType' , 'Gender' , 'Number' , 'Case' ]
135
+ rf = ['PronType' ]
136
+ if node .feats ['Case' ]:
137
+ rf .extend (['Gender' , 'Number' , 'Case' ])
119
138
af = {
120
139
'Gender' : ['Masc' , 'Fem' , 'Neut' ],
121
140
'Number' : ['Sing' , 'Plur' ],
122
- 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ]}
141
+ 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ],
142
+ 'Degree' : ['Cmp' , 'Abs' , 'Sup' ],
143
+ 'Polarity' : ['Neg' ]
144
+ }
123
145
if node .feats ['Poss' ] == 'Yes' : # 'meus', 'tuus', 'suus', 'noster'
124
146
rf .extend (['Poss' , 'Person[psor]' ])
125
147
af ['PronType' ] = ['Prs' ]
@@ -131,11 +153,16 @@ def process_node(self, node):
131
153
rf .append ('Number[psor]' )
132
154
af ['Number[psor]' ] = ['Sing' , 'Plur' ]
133
155
else :
134
- af ['PronType' ] = ['Dem' , 'Rel' , 'Ind' , 'Tot' , 'Con' ]
156
+ af ['PronType' ] = ['Dem' , 'Rel' , 'Ind' , 'Int' , ' Tot' , 'Con' ]
135
157
if self .flavio :
136
158
# Flavio added InflClass but not everywhere, so it is not required.
137
- af ['InflClass' ] = ['IndEurA' , 'IndEurI' , 'IndEurO' , 'LatPron' ]
159
+ af ['InflClass' ] = ['IndEurA' , 'IndEurI' , 'IndEurO' , 'IndEurX' , 'LatPron' ]
160
+ af ['Compound' ] = ['Yes' ]
138
161
af ['Form' ] = ['Emp' ]
162
+ af ['NumType' ] = ['Card' ]
163
+ af ['Degree' ].append ('Dim' )
164
+ if re .match (r'^(unus|ambo)' , node .lemma ):
165
+ af ['NumValue' ] = ['1' , '2' ]
139
166
self .check_required_features (node , rf )
140
167
self .check_allowed_features (node , af )
141
168
# NUMERALS #############################################################
@@ -151,71 +178,103 @@ def process_node(self, node):
151
178
af ['Number' ] = ['Sing' , 'Plur' ]
152
179
af ['Case' ] = ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ]
153
180
if self .flavio :
154
- # Flavio added InflClass but not everywhere, so it is not required.
181
+ # Flavio added InflClass but not everywhere, so it is not required. # e.g. duodecim
155
182
af ['InflClass' ] = ['IndEurA' , 'IndEurI' , 'IndEurO' , 'LatPron' ]
156
183
self .check_required_features (node , rf )
157
184
self .check_allowed_features (node , af )
158
185
# VERBS AND AUXILIARIES ################################################
159
186
elif re .match (r'^(VERB|AUX)$' , node .upos ):
160
- rf = ['VerbForm' ]
187
+ rf = ['VerbForm' , 'Aspect' ]
161
188
af = {
162
- 'VerbForm' : ['Inf' , 'Fin' , 'Part' , 'Vnoun' ],
163
- 'Polarity' : ['Pos' , 'Neg' ]}
189
+ 'VerbForm' : ['Inf' , 'Fin' , 'Part' ],
190
+ 'Aspect' : ['Imp' , 'Inch' , 'Perf' , 'Prosp' ],
191
+ 'Polarity' : ['Neg' ]
192
+ }
193
+ if not re .match (r'^(Ger|Gdv)$' , node .feats ['VerbForm' ]):
194
+ rf .append ('Tense' )
195
+ af ['Tense' ] = ['Pres' , 'Fut' ]
196
+ if node .upos == 'VERB' : # and not node.lemma.endswith('sum'): # compounds of sum
197
+ rf .append ('Voice' )
198
+ af ['Voice' ] = ['Act' , 'Pass' ]
164
199
# Main verbs have aspect but auxiliaries don't.
165
- if node .upos == 'VERB' :
166
- rf .append ('Aspect' )
167
- af ['Aspect' ] = ['Imp' , 'Perf' , 'Prosp' ]
168
- if node .feats ['VerbForm' ] == 'Fin' :
200
+ # TODO: apparently, apparently AUXs have aspect as well
201
+ # if node.upos == 'VERB':
202
+ # rf.append('Aspect')
203
+ # af['Aspect'] = ['Imp', 'Inch', 'Perf', 'Prosp']
204
+ if node .feats ['VerbForm' ] == 'Fin' : # imperative, indicative or subjunctive
169
205
rf .extend (['Mood' , 'Person' , 'Number' ])
206
+ af ['Tense' ].extend (['Past' , 'Pqp' ])
170
207
af ['Mood' ] = ['Ind' , 'Sub' , 'Imp' ]
171
208
af ['Person' ] = ['1' , '2' , '3' ]
172
209
af ['Number' ] = ['Sing' , 'Plur' ]
173
- if re .match (r'^(Ind|Sub)$' , node .feats ['Mood' ]): # indicative or subjunctive
174
- rf .extend (['Voice' , 'Tense' ])
175
- af ['Voice' ] = ['Act' , 'Pass' ]
176
- af ['Tense' ] = ['Past' , 'Imp' , 'Pres' , 'Fut' ]
177
210
elif node .feats ['VerbForm' ] == 'Part' :
178
- rf .extend (['Tense' , 'Gender' , 'Number' , 'Voice' , 'Case' ])
179
- af ['Tense' ] = ['Past' ]
180
- af ['Voice' ] = ['Act' , 'Pass' ]
211
+ rf .extend (['Gender' , 'Number' , 'Case' ])
181
212
af ['Number' ] = ['Sing' , 'Plur' ]
182
213
af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
183
214
af ['Case' ] = ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' ]
184
- af ['Degree' ] = ['Abs' ]
185
- elif node .feats ['VerbForm' ] == 'Vnoun' :
186
- rf .extend (['Tense' , 'Voice' ])
187
- af ['Tense' ] = ['Past' , 'Pres' ]
188
- af ['Voice' ] = ['Act' , 'Pass' ]
215
+ af ['Degree' ] = ['Abs' , 'Cmp' ]
189
216
af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
190
- # else: nothing to be added form VerbForm=Inf
217
+ af ['Tense' ].append ('Past' )
218
+ # else: nothing to be added for VerbForm=Inf
191
219
if self .flavio :
192
220
# Flavio has killed Tense in his treebanks.
193
221
rf = [f for f in rf if f != 'Tense' ]
222
+ af ['VerbForm' ].append ('Vnoun' )
194
223
# Flavio added InflClass but not everywhere, so it is not required.
195
- af ['InflClass' ] = ['LatA' , 'LatAnom' , 'LatE' , 'LatI2' , 'LatX' ]
196
- if node .feats ['VerbForm' ] == 'Part' :
224
+ af ['InflClass' ] = ['LatA' , 'LatAnom' , 'LatE' , 'LatI' , 'LatI2' , 'LatX' ]
225
+ if 'Degree' in af :
226
+ af ['Degree' ].append ('Dim' )
227
+ else :
228
+ af ['Degree' ] = ['Dim' ]
229
+ af ['Compound' ] = ['Yes' ]
230
+ af ['Proper' ] = ['Yes' ]
231
+ if re .match (r'^(Part|Vnoun)$' , node .feats ['VerbForm' ]):
197
232
af ['InflClass[nominal]' ] = ['IndEurA' , 'IndEurI' , 'IndEurO' ]
233
+ af ['VerbForm' ].append ('Vnoun' )
198
234
self .check_required_features (node , rf )
199
235
self .check_allowed_features (node , af )
200
236
# ADVERBS ##############################################################
201
237
elif node .upos == 'ADV' :
202
238
af = {
203
239
'AdvType' : ['Loc' , 'Tim' ],
204
240
'PronType' : ['Dem' , 'Int' , 'Rel' , 'Ind' , 'Neg' , 'Tot' , 'Con' ],
205
- 'Degree' : ['Pos' , 'Cmp' , 'Sup' , 'Abs' ]
241
+ 'Degree' : ['Pos' , 'Cmp' , 'Sup' , 'Abs' ],
242
+ 'Polarity' : ['Neg' ]
206
243
}
207
244
if self .flavio :
208
- af ['Compound' ] = 'Yes'
209
- af ['Form' ] = 'Emp'
245
+ af ['Compound' ] = ['Yes' ]
246
+ af ['Form' ] = ['Emp' ]
247
+ af ['NumType' ] = ['Card' , 'Ord' ] # e.g., primum
248
+ af ['VerbForm' ] = ['Part' ]
249
+ af ['Degree' ].append ('Dim' )
210
250
self .check_allowed_features (node , af )
211
251
# PARTICLES ############################################################
212
252
elif node .upos == 'PART' :
213
253
af = {
214
- 'PartType' : ['Int' ],
254
+ 'PartType' : ['Int' , 'Emp' ],
215
255
'Polarity' : ['Neg' ]
216
256
}
217
257
if self .flavio :
218
- af ['Form' ] = 'Emp'
258
+ af ['Form' ] = ['Emp' ]
259
+ af ['PronType' ] = ['Dem' ]
260
+ self .check_allowed_features (node , af )
261
+ # CONJUNCTIONS #########################################################
262
+ elif re .match (r'^[CS]CONJ$' , node .upos ):
263
+ af = {
264
+ 'PronType' : ['Rel' , 'Con' ],
265
+ 'Polarity' : ['Neg' ]}
266
+ if self .flavio :
267
+ af ['Compound' ] = ['Yes' ]
268
+ af ['Form' ] = ['Emp' ]
269
+ af ['VerbForm' ] = ['Fin' ]
270
+ af ['NumType' ] = ['Card' ]
271
+ self .check_allowed_features (node , af )
272
+ # ADPOSITIONS ##########################################################
273
+ elif node .upos == 'ADP' :
274
+ if self .flavio :
275
+ af = {
276
+ 'VerbForm' : ['Part' ],
277
+ 'Proper' : ['Yes' ]}
219
278
self .check_allowed_features (node , af )
220
279
# THE REST: NO FEATURES ################################################
221
280
else :
0 commit comments