︙ | | | ︙ | |
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
aSugg.add(sFlex+"s")
if _oSpellChecker.isValid(sFlex+"x"):
aSugg.add(sFlex+"x")
if mfsp.hasMiscPlural(sFlex):
aSugg.update(mfsp.getMiscPlural(sFlex))
if not aSugg and bSelfSugg and sFlex.endswith(("s", "x", "S", "X")):
aSugg.add(sFlex)
if aSugg:
return "|".join(aSugg)
return ""
def suggSing (sFlex, bSelfSugg=True):
"returns singular forms assuming sFlex is plural"
|
>
|
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
aSugg.add(sFlex+"s")
if _oSpellChecker.isValid(sFlex+"x"):
aSugg.add(sFlex+"x")
if mfsp.hasMiscPlural(sFlex):
aSugg.update(mfsp.getMiscPlural(sFlex))
if not aSugg and bSelfSugg and sFlex.endswith(("s", "x", "S", "X")):
aSugg.add(sFlex)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def suggSing (sFlex, bSelfSugg=True):
"returns singular forms assuming sFlex is plural"
|
︙ | | | ︙ | |
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
aSugg.add(sFlex[:-2]+"L")
if _oSpellChecker.isValid(sFlex[:-2]+"IL"):
aSugg.add(sFlex[:-2]+"IL")
if sFlex.endswith(("s", "x", "S", "X")) and _oSpellChecker.isValid(sFlex[:-1]):
aSugg.add(sFlex[:-1])
if bSelfSugg and not aSugg:
aSugg.add(sFlex)
if aSugg:
return "|".join(aSugg)
return ""
def suggMasSing (sFlex, bSuggSimil=False):
"returns masculine singular forms"
|
>
|
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
aSugg.add(sFlex[:-2]+"L")
if _oSpellChecker.isValid(sFlex[:-2]+"IL"):
aSugg.add(sFlex[:-2]+"IL")
if sFlex.endswith(("s", "x", "S", "X")) and _oSpellChecker.isValid(sFlex[:-1]):
aSugg.add(sFlex[:-1])
if bSelfSugg and not aSugg:
aSugg.add(sFlex)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def suggMasSing (sFlex, bSuggSimil=False):
"returns masculine singular forms"
|
︙ | | | ︙ | |
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
if conj.hasConj(sVerb, ":PQ", ":Q1") and conj.hasConj(sVerb, ":PQ", ":Q3"):
# We also check if the verb has a feminine form.
# If not, we consider it’s better to not suggest the masculine one, as it can be considered invariable.
aSugg.add(conj.getConj(sVerb, ":PQ", ":Q1"))
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":m:[si]"):
aSugg.add(e)
if aSugg:
return "|".join(aSugg)
return ""
def suggMasPlur (sFlex, bSuggSimil=False):
"returns masculine plural forms"
|
>
|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
if conj.hasConj(sVerb, ":PQ", ":Q1") and conj.hasConj(sVerb, ":PQ", ":Q3"):
# We also check if the verb has a feminine form.
# If not, we consider it’s better to not suggest the masculine one, as it can be considered invariable.
aSugg.add(conj.getConj(sVerb, ":PQ", ":Q1"))
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":m:[si]"):
aSugg.add(e)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def suggMasPlur (sFlex, bSuggSimil=False):
"returns masculine plural forms"
|
︙ | | | ︙ | |
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
sSugg = conj.getConj(sVerb, ":PQ", ":Q1")
# it is necessary to filter these flexions, like “succédé” or “agi” that are not masculine plural.
if sSugg.endswith("s"):
aSugg.add(sSugg)
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":m:[pi]"):
aSugg.add(e)
if aSugg:
return "|".join(aSugg)
return ""
def suggFemSing (sFlex, bSuggSimil=False):
"returns feminine singular forms"
|
>
|
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
sSugg = conj.getConj(sVerb, ":PQ", ":Q1")
# it is necessary to filter these flexions, like “succédé” or “agi” that are not masculine plural.
if sSugg.endswith("s"):
aSugg.add(sSugg)
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":m:[pi]"):
aSugg.add(e)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def suggFemSing (sFlex, bSuggSimil=False):
"returns feminine singular forms"
|
︙ | | | ︙ | |
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
# a verb
sVerb = cr.getLemmaOfMorph(sMorph)
if conj.hasConj(sVerb, ":PQ", ":Q3"):
aSugg.add(conj.getConj(sVerb, ":PQ", ":Q3"))
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":f:[si]"):
aSugg.add(e)
if aSugg:
return "|".join(aSugg)
return ""
def suggFemPlur (sFlex, bSuggSimil=False):
"returns feminine plural forms"
|
>
|
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
# a verb
sVerb = cr.getLemmaOfMorph(sMorph)
if conj.hasConj(sVerb, ":PQ", ":Q3"):
aSugg.add(conj.getConj(sVerb, ":PQ", ":Q3"))
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":f:[si]"):
aSugg.add(e)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def suggFemPlur (sFlex, bSuggSimil=False):
"returns feminine plural forms"
|
︙ | | | ︙ | |
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
# a verb
sVerb = cr.getLemmaOfMorph(sMorph)
if conj.hasConj(sVerb, ":PQ", ":Q4"):
aSugg.add(conj.getConj(sVerb, ":PQ", ":Q4"))
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":f:[pi]"):
aSugg.add(e)
if aSugg:
return "|".join(aSugg)
return ""
def hasFemForm (sFlex):
"return True if there is a feminine form of <sFlex>"
|
>
|
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
# a verb
sVerb = cr.getLemmaOfMorph(sMorph)
if conj.hasConj(sVerb, ":PQ", ":Q4"):
aSugg.add(conj.getConj(sVerb, ":PQ", ":Q4"))
if bSuggSimil:
for e in phonet.selectSimil(sFlex, ":f:[pi]"):
aSugg.add(e)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def hasFemForm (sFlex):
"return True if there is a feminine form of <sFlex>"
|
︙ | | | ︙ | |