71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
|
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
|
def suggVerbPpas (sFlex, sPattern=None):
"suggest past participles for <sFlex>"
dSugg = {}
for sStem in _oSpellChecker.getLemma(sFlex):
tTags = conj._getTags(sStem)
if tTags:
if not sPattern:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:p")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":f:s")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":f:p")] = ""
elif sPattern == ":m:s":
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
elif sPattern == ":m:p":
if conj._hasConjWithTags(tTags, ":PQ", ":Q2"):
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = ""
if conj._hasConjWithTags(tTags, ":Q", ":m:p"):
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:p")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
elif sPattern == ":f:s":
if conj._hasConjWithTags(tTags, ":PQ", ":Q3"):
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = ""
if conj._hasConjWithTags(tTags, ":Q", ":f:s"):
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":f:s")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
elif sPattern == ":f:p":
if conj._hasConjWithTags(tTags, ":PQ", ":Q4"):
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = ""
if conj._hasConjWithTags(tTags, ":Q", ":f:p"):
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":f:p")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
elif sPattern == ":s":
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":f:s")] = ""
elif sPattern == ":p":
if conj._hasConjWithTags(tTags, ":PQ", ":Q2"):
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = ""
if conj._hasConjWithTags(tTags, ":Q", ":m:p"):
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:p")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":f:p")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":Q", ":m:s")] = ""
if "" in dSugg:
del dSugg[""]
if dSugg:
return "|".join(dSugg.keys())
return ""
|
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
-
-
-
-
+
+
+
+
|
else:
sStem = cr.getLemmaOfMorph(sMorph)
if mfsp.isMasForm(sStem):
dSugg[suggPlur(sStem, True)] = ""
else:
# a verb
sVerb = cr.getLemmaOfMorph(sMorph)
if conj.hasConj(sVerb, ":PQ", ":Q2"):
dSugg[conj.getConj(sVerb, ":PQ", ":Q2")] = ""
elif conj.hasConj(sVerb, ":PQ", ":Q1"):
sSugg = conj.getConj(sVerb, ":PQ", ":Q1")
if conj.hasConj(sVerb, ":Q", ":m:p"):
dSugg[conj.getConj(sVerb, ":Q", ":m:p")] = ""
elif conj.hasConj(sVerb, ":Q", ":m:s"):
sSugg = conj.getConj(sVerb, ":Q", ":m:s")
# it is necessary to filter these flexions, like “succédé” or “agi” that are not masculine plural.
if sSugg.endswith("s"):
dSugg[sSugg] = ""
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":m:[pi]"):
dSugg[e] = ""
if dSugg:
|