2
2
import udapi .block .ud .addmwt
3
3
4
4
MWTS = {
5
- 'mecum' : {'lemma' : 'ego cum' , 'form' : 'me cum' , 'feats' : 'Case=Abl|Gender=Masc|Number=Sing AdpType=Post|Clitic=Yes' },
6
- 'tecum' : {'lemma' : 'tu cum' , 'form' : 'te cum' , 'feats' : 'Case=Abl|Gender=Masc|Number=Sing AdpType=Post|Clitic=Yes' },
7
- 'nobiscum' : {'lemma' : 'nos cum' , 'form' : 'nobis cum' , 'feats' : 'Case=Abl|Gender=Neut|Number=Plur AdpType=Post|Clitic=Yes' },
8
- 'vobiscum' : {'lemma' : 'vos cum' , 'form' : 'vobis cum' , 'feats' : 'Case=Abl|Gender=Masc|Number=Plur AdpType=Post|Clitic=Yes' },
9
- 'uobiscum' : {'lemma' : 'uos cum' , 'form' : 'uobis cum' , 'feats' : 'Case=Abl|Gender=Masc|Number=Plur AdpType=Post|Clitic=Yes' },
10
- 'secum' : {'lemma' : 'sui cum' , 'form' : 'se cum' , 'feats' : 'Case=Abl|Gender=Masc AdpType=Post|Clitic=Yes' }, # can be singular or plural
5
+ 'mecum' : {'lemma' : 'ego cum' , 'form' : 'me cum' , 'upos' : 'PRON ADP' , 'feats' : 'Case=Abl|Gender=Masc|Number=Sing AdpType=Post|Clitic=Yes' , 'deprel' : 'obl case' },
6
+ 'tecum' : {'lemma' : 'tu cum' , 'form' : 'te cum' , 'upos' : 'PRON ADP' , 'feats' : 'Case=Abl|Gender=Masc|Number=Sing AdpType=Post|Clitic=Yes' , 'deprel' : 'obl case' },
7
+ 'nobiscum' : {'lemma' : 'nos cum' , 'form' : 'nobis cum' , 'upos' : 'PRON ADP' , 'feats' : 'Case=Abl|Gender=Neut|Number=Plur AdpType=Post|Clitic=Yes' , 'deprel' : 'obl case' },
8
+ 'vobiscum' : {'lemma' : 'vos cum' , 'form' : 'vobis cum' , 'upos' : 'PRON ADP' , 'feats' : 'Case=Abl|Gender=Masc|Number=Plur AdpType=Post|Clitic=Yes' , 'deprel' : 'obl case' },
9
+ 'uobiscum' : {'lemma' : 'uos cum' , 'form' : 'uobis cum' , 'upos' : 'PRON ADP' , 'feats' : 'Case=Abl|Gender=Masc|Number=Plur AdpType=Post|Clitic=Yes' , 'deprel' : 'obl case' },
10
+ 'secum' : {'lemma' : 'sui cum' , 'form' : 'se cum' , 'upos' : 'PRON ADP' , 'feats' : 'Case=Abl|Gender=Masc AdpType=Post|Clitic=Yes' , 'deprel' : 'obl case' }, # can be singular or plural
11
+ 'nonne' : {'lemma' : 'non ne' , 'form' : 'non ne' , 'upos' : 'PART PART' , 'feats' : 'Polarity=Neg Clitic=Yes|PartType=Int' , 'deprel' : 'advmod:neg discourse' , 'shape' : 'sibling' }
11
12
}
12
13
13
14
# shared values for all entries in MWTS
14
15
for v in MWTS .values ():
15
- v ['upos' ] = 'PRON ADP'
16
16
# v['xpos'] = '' # treebank-specific
17
- v ['deprel' ] = 'obl case'
17
+ if 'shape' not in v :
18
+ v ['shape' ] = 'subtree'
18
19
v ['main' ] = 0
19
- v ['shape' ] = 'subtree'
20
20
21
21
22
22
class AddMwt (udapi .block .ud .addmwt .AddMwt ):
@@ -29,30 +29,13 @@ def multiword_analysis(self, node):
29
29
return analysis
30
30
31
31
if node .form .endswith ('.' ) and len (node .form ) > 1 and node .form != '...' :
32
- dic = {
33
- 'form' : 'x .' ,
32
+ # currently under discussion
33
+ return { 'form' : node . form [: - 1 ] + ' .' ,
34
34
'lemma' : '* .' ,
35
35
'upos' : '* PUNCT' ,
36
36
'xpos' : '_ _' ,
37
37
'feats' : '* _' ,
38
38
'deprel' : '* punct' ,
39
39
'main' : 0 ,
40
- 'shape' : 'subtree'
41
- }
42
- forma = node .form [:- 1 ] + ' .'
43
- dic .update (form = forma )
44
- return dic
45
- elif node .lemma == 'nonne' :
46
- dic = {
47
- 'form' : 'non ne' ,
48
- 'lemma' : 'non ne' ,
49
- 'upos' : 'PART PART' ,
50
- # 'xpos': '_ _', # treebank-specific
51
- 'feats' : 'Polarity=Neg Clitic=Yes|PartType=Int' ,
52
- 'deprel' : 'advmod:neg discourse' ,
53
- 'main' : 0 ,
54
- 'shape' : 'sibling'
55
- }
56
- return dic
57
- return None
40
+ 'shape' : 'subtree' }
58
41
0 commit comments