25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
+
|
_HELP = """
Analysis commands:
any_text grammar checking
?word1 [word2] ... words analysis
!word spelling suggestion
>word draw path of word in the word graph
=[filter1][=[filter2]] show entries which fit to filters (filter1 for word, filter2 for morphology)
≠word|word|… show distance between words
≠word1 word2 [word3] ... show distance between words
$some_text show sentences and tokens of text
Other commands:
/help /h show this text
/lopt /lo list options
/lrules [pattern] /lr list rules
/o+ option1 [option2] ... activate grammar checking options
|
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
-
+
+
+
+
|
else:
sFlexPattern = sSearch
sTagsPattern = ""
for aRes in oSpellChecker.select(sFlexPattern, sTagsPattern):
echo("{:<30} {:<30} {}".format(*aRes))
elif sText.startswith("≠"):
# distances calculation
lWords = sText[1:].split("|")
lWords = sText[1:].split()
for s1, s2 in itertools.combinations(lWords, 2):
strt.showDistance(s1, s2)
if xArgs.debug:
strt.showDistance(strt.simplifyWord(s1), strt.simplifyWord(s2))
echo("")
elif sText.startswith("/o+ "):
oGrammarChecker.gce.setOptions({ opt:True for opt in sText[3:].strip().split() if opt in oGrammarChecker.gce.getOptions() })
echo("done")
elif sText.startswith("/o- "):
oGrammarChecker.gce.setOptions({ opt:False for opt in sText[3:].strip().split() if opt in oGrammarChecker.gce.getOptions() })
echo("done")
elif sText.startswith("/r- "):
|