@@ -27,50 +27,38 @@ def process_node(self, node):
27
27
'Foreign' : ['Yes' ]})
28
28
# PRONOUNS #############################################################
29
29
elif node .upos == 'PRON' :
30
- self .check_required_features (node , ['PronType' ])
30
+ rf = ['PronType' , 'Case' ]
31
+ af = {
32
+ 'PronType' : ['Prs' , 'Int' ], # demonstrative pronouns are treated as third person personal pronouns
33
+ 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' , 'Ins' , 'Cmp' ]
34
+ }
31
35
if node .feats ['PronType' ] == 'Prs' :
36
+ af ['Reflex' ] = ['Yes' ]
32
37
if node .feats ['Reflex' ] == 'Yes' :
33
- self .check_required_features (node , ['PronType' , 'Reflex' , 'Case' ])
34
- self .check_allowed_features (node , {
35
- 'PronType' : ['Prs' ],
36
- 'Reflex' : ['Yes' ],
37
- 'Case' : ['Gen' , 'Dat' , 'Acc' , 'Loc' , 'Abl' , 'Ins' , 'Cmp' ]
38
- })
38
+ af ['Case' ] = [c for c in af ['Case' ] if c != 'Nom' and c != 'Voc' ]
39
39
else : # not reflexive
40
- if node .feats ['Person' ] == '3' : # അവൻ avan, അവൾ avaḷ, അത് at, അവർ avaṟ
40
+ rf .extend (['Person' , 'Number' ])
41
+ af ['Person' ] = ['1' , '2' , '3' ]
42
+ af ['Number' ] = ['Sing' , 'Plur' ]
43
+ # 1st and 2nd person do not have gender: ഞാൻ ñān, നീ nī; or 3rd person താൻ tān̕
44
+ if node .feats ['Person' ] == '3' and not node .lemma == 'താൻ' : # അവൻ avan, അവൾ avaḷ, അത് at, അവർ avaṟ; but not താൻ tān̕
45
+ rf .append ('Deixis' )
46
+ af ['Deixis' ] = ['Prox' , 'Remt' ]
41
47
if node .feats ['Number' ] == 'Sing' :
42
- self .check_required_features (node , ['PronType' , 'Person' , 'Deixis' , 'Gender' , 'Number' , 'Case' ])
43
- self .check_allowed_features (node , {
44
- 'PronType' : ['Prs' ],
45
- 'Person' : ['3' ],
46
- 'Deixis' : ['Prox' , 'Remt' ],
47
- 'Gender' : ['Masc' , 'Fem' , 'Neut' ],
48
- 'Number' : ['Sing' ],
49
- 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' , 'Ins' , 'Cmp' ]
50
- })
51
- else : # plural pronouns do not distinguish gender
52
- self .check_required_features (node , ['PronType' , 'Person' , 'Deixis' , 'Number' , 'Case' ])
53
- self .check_allowed_features (node , {
54
- 'PronType' : ['Prs' ],
55
- 'Person' : ['3' ],
56
- 'Deixis' : ['Prox' , 'Remt' ],
57
- 'Number' : ['Plur' ],
58
- 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' , 'Ins' , 'Cmp' ]
59
- })
60
- else : # 1st and 2nd person do not have gender: ഞാൻ ñān, നീ nī
61
- self .check_required_features (node , ['PronType' , 'Person' , 'Number' , 'Case' ])
62
- self .check_allowed_features (node , {
63
- 'PronType' : ['Prs' ],
64
- 'Person' : ['1' , '2' ],
65
- 'Number' : ['Sing' , 'Plur' ],
66
- 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' , 'Ins' , 'Cmp' ]
67
- })
68
- else : # not personal
69
- self .check_required_features (node , ['PronType' , 'Case' ])
70
- self .check_allowed_features (node , {
71
- 'PronType' : ['Dem' , 'Int' ],
72
- 'Case' : ['Nom' , 'Gen' , 'Dat' , 'Acc' , 'Voc' , 'Loc' , 'Abl' , 'Ins' , 'Cmp' ]
73
- })
48
+ rf .append ('Gender' )
49
+ af ['Gender' ] = ['Masc' , 'Fem' , 'Neut' ]
50
+ # third person singular neuter pronouns also distinguish animacy (animate neuter are animals and plants, they have a different accusative form)
51
+ if node .feats ['Gender' ] == 'Neut' :
52
+ rf .append ('Animacy' )
53
+ af ['Animacy' ] = ['Anim' , 'Inan' ]
54
+ else : # plural pronouns do not distinguish gender but they do distinguish animacy
55
+ rf .append ('Animacy' )
56
+ af ['Animacy' ] = ['Anim' , 'Inan' ]
57
+ elif node .feats ['Person' ] == '1' and node .feats ['Number' ] == 'Plur' :
58
+ rf .append ('Clusivity' )
59
+ af ['Clusivity' ] = ['In' , 'Ex' ]
60
+ self .check_required_features (node , rf )
61
+ self .check_allowed_features (node , af )
74
62
# DETERMINERS ##########################################################
75
63
elif node .upos == 'DET' :
76
64
if node .feats ['PronType' ] == 'Art' :
@@ -82,7 +70,8 @@ def process_node(self, node):
82
70
else :
83
71
self .check_required_features (node , ['PronType' ])
84
72
self .check_allowed_features (node , {
85
- 'PronType' : ['Dem' , 'Int' , 'Rel' , 'Ind' , 'Neg' , 'Tot' ]
73
+ 'PronType' : ['Dem' , 'Int' , 'Rel' , 'Ind' , 'Neg' , 'Tot' ],
74
+ 'Deixis' : ['Prox' , 'Remt' ]
86
75
})
87
76
# NUMERALS #############################################################
88
77
elif node .upos == 'NUM' :
0 commit comments