51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
-
+
-
+
|
def getVtyp (sVerb):
"returns raw informations about sVerb"
if sVerb not in _dVerb:
return None
return _lVtyp[_dVerb[sVerb][0]]
def getSimil (sWord, sMorph):
def getSimil (sWord, sMorph, sFilter=None):
if ":V" not in sMorph:
return set()
sInfi = sMorph[1:sMorph.find(" ")]
tTags = _getTags(sInfi)
aSugg = set()
if ":Q" in sMorph:
if ":Q" in sMorph or ":Y" in sMorph:
# we suggest conjugated forms
if ":V1" in sMorph:
aSugg.add(sInfi)
aSugg.add(_getConjWithTags(sInfi, tTags, ":Ip", ":3s"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Ip", ":2p"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Iq", ":1s"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Iq", ":3s"))
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q2"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q3"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q4"))
aSugg.discard("")
# if there is only one past participle (epi inv), unreliable.
if len(aSugg) == 1:
aSugg.clear()
if ":V1" in sMorph:
aSugg.add(sInfi)
return aSugg
def getConjSimilInfiV1 (sInfi):
if sInfi not in _dVerb:
return set()
tTags = _getTags(sInfi)
aSugg = set()
aSugg.add(_getConjWithTags(sInfi, tTags, ":Iq", ":2s"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Iq", ":3s"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Iq", ":3p"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Is", ":1s"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Ip", ":2p"))
aSugg.add(_getConjWithTags(sInfi, tTags, ":Iq", ":2p"))
aSugg.discard("")
return aSugg
def _getTags (sVerb):
"returns tuple of tags (usable with functions _getConjWithTags and _hasConjWithTags)"
if sVerb not in _dVerb:
return None
|