Skip to content

Commit ab86f1b

Browse files
committed
Refined features of pronouns in Malayalam.
1 parent 8b05a49 commit ab86f1b

File tree

1 file changed

+30
-41
lines changed

1 file changed

+30
-41
lines changed

udapi/block/ud/ml/markfeatsbugs.py

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,38 @@ def process_node(self, node):
2727
'Foreign': ['Yes']})
2828
# PRONOUNS #############################################################
2929
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+
}
3135
if node.feats['PronType'] == 'Prs':
36+
af['Reflex'] = ['Yes']
3237
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']
3939
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']
4147
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)
7462
# DETERMINERS ##########################################################
7563
elif node.upos == 'DET':
7664
if node.feats['PronType'] == 'Art':
@@ -82,7 +70,8 @@ def process_node(self, node):
8270
else:
8371
self.check_required_features(node, ['PronType'])
8472
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']
8675
})
8776
# NUMERALS #############################################################
8877
elif node.upos == 'NUM':

0 commit comments

Comments
 (0)