282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
echo(" - " + sElem)
for sMorph, sMeaning in aRes:
echo(" {:<40} {}".format(sMorph, sMeaning))
elif sText.startswith("!"):
# spelling suggestions
for sWord in sText[1:].strip().split():
if sWord:
for lSugg in oSpellChecker.suggest(sWord):
echo(" | ".join(lSugg))
if xArgs.debug:
for sSugg in lSugg:
nDist = strt.distanceDamerauLevenshteinX(sWord, sSugg)
echo(f"{sSugg:30} {nDist}")
elif sText.startswith(">"):
# path in the word graph
oSpellChecker.drawPath(sText[1:].strip())
elif sText.startswith("="):
# search in dictionnary
sSearch = sText[1:].strip()
if "=" in sSearch:
|
>
>
|
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
echo(" - " + sElem)
for sMorph, sMeaning in aRes:
echo(" {:<40} {}".format(sMorph, sMeaning))
elif sText.startswith("!"):
# spelling suggestions
for sWord in sText[1:].strip().split():
if sWord:
print(sWord)
for lSugg in oSpellChecker.suggest(sWord):
echo(" | ".join(lSugg))
if xArgs.debug:
for sSugg in lSugg:
nDist = strt.distanceDamerauLevenshteinX(sWord, sSugg)
echo(f"{sSugg:30} {nDist}")
print()
elif sText.startswith(">"):
# path in the word graph
oSpellChecker.drawPath(sText[1:].strip())
elif sText.startswith("="):
# search in dictionnary
sSearch = sText[1:].strip()
if "=" in sSearch:
|