339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
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>"
for sStem in _oSpellChecker.getLemma(sFlex):
if mfsp.isMasForm(sStem) or conj.hasConj(sStem, ":PQ", ":Q3"):
return True
if phonet.hasSimil(sFlex, ":f"):
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
for e in phonet.selectSimil(sFlex, ":f:[pi]"):
aSugg.add(e)
aSugg.discard("")
if aSugg:
return "|".join(aSugg)
return ""
def g_suggAgree (dTokenDst, dTokenSrc):
"returns suggestions for <dTokenDst> that matches agreement with <dTokenSrc>"
lMorphSrc = dTokenSrc["lMorph"] if "lMorph" in dTokenSrc else _oSpellChecker.getMorph(dTokenSrc["sValue"])
if not lMorphSrc:
return ""
sGender, sNumber = cr.getGenderNumber(lMorphSrc)
if sGender == ":m":
if sNumber == ":s":
return suggMasSing(dTokenDst["sValue"])
elif sNumber == ":p":
return suggMasPlur(dTokenDst["sValue"])
return suggMasSing(dTokenDst["sValue"])
elif sGender == ":f":
if sNumber == ":s":
return suggFemSing(dTokenDst["sValue"])
elif sNumber == ":p":
return suggFemPlur(dTokenDst["sValue"])
return suggFemSing(dTokenDst["sValue"])
elif sGender == ":e":
if sNumber == ":s":
return suggSing(dTokenDst["sValue"])
elif sNumber == ":p":
return suggPlur(dTokenDst["sValue"])
return dTokenDst["sValue"]
return ""
def hasFemForm (sFlex):
"return True if there is a feminine form of <sFlex>"
for sStem in _oSpellChecker.getLemma(sFlex):
if mfsp.isMasForm(sStem) or conj.hasConj(sStem, ":PQ", ":Q3"):
return True
if phonet.hasSimil(sFlex, ":f"):
|