Skip to content

Commit 6fe35b1

Browse files
authored
Improvement of addmwt.py
1 parent 4e875c5 commit 6fe35b1

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

udapi/block/ud/la/addmwt.py

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
import udapi.block.ud.addmwt
33

44
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'}
1112
}
1213

1314
# shared values for all entries in MWTS
1415
for v in MWTS.values():
15-
v['upos'] = 'PRON ADP'
1616
# v['xpos'] = '' # treebank-specific
17-
v['deprel'] = 'obl case'
17+
if 'shape' not in v:
18+
v['shape'] = 'subtree'
1819
v['main'] = 0
19-
v['shape'] = 'subtree'
2020

2121

2222
class AddMwt(udapi.block.ud.addmwt.AddMwt):
@@ -29,30 +29,13 @@ def multiword_analysis(self, node):
2929
return analysis
3030

3131
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] + ' .',
3434
'lemma': '* .',
3535
'upos': '* PUNCT',
3636
'xpos': '_ _',
3737
'feats': '* _',
3838
'deprel': '* punct',
3939
'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'}
5841

0 commit comments

Comments
 (0)