16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
+
+
+
|
_EXAMPLE = "Quoi ? Racontes ! Racontes-moi ! Bon sangg, parles ! Oui. Il y a des menteur partout. " \
"Je suit sidéré par la brutales arrogance de cette homme-là. Quelle salopard ! Un escrocs de la pire espece. " \
"Quant sera t’il châtiés pour ses mensonge ? Merde ! J’en aie marre."
_HELP = """
/help /h show this text
?word1 [word2] ... words analysis
!word suggestion
>word draw path of word in the word graph
=filter show all entries whose morphology fits to filter
/lopt /lo list options
/+ option1 [option2] ... activate grammar checking options
/- option1 [option2] ... deactivate grammar checking options
/lrules [pattern] /lr list rules
/--rule1 [rule2] ... deactivate grammar checking rule
/++rule1 [rule2] ... reactivate grammar checking rule
/quit /q exit
|
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
-
+
+
+
+
+
+
+
+
+
+
|
# pseudo-console
sInputText = "\n~==========~ Enter your text [/h /q] ~==========~\n"
sText = _getText(sInputText)
while True:
if sText.startswith("?"):
for sWord in sText[1:].strip().split():
if sWord:
echo("* {}".format(sWord))
echo("* " + sWord)
for sMorph in oDict.getMorph(sWord):
echo(" {:<32} {}".format(sMorph, oLexGraphe.formatTags(sMorph)))
elif sText.startswith("!"):
for sWord in sText[1:].strip().split():
if sWord:
echo(" | ".join(oDict.suggest(sWord)))
elif sText.startswith(">"):
oDict.drawPath(sText[1:].strip())
elif sText.startswith("="):
for sRes in oDict.select(sText[1:].strip()):
echo(sRes)
elif sText.startswith("/+ "):
gce.setOptions({ opt:True for opt in sText[3:].strip().split() if opt in gce.getOptions() })
echo("done")
elif sText.startswith("/- "):
gce.setOptions({ opt:False for opt in sText[3:].strip().split() if opt in gce.getOptions() })
echo("done")
elif sText.startswith("/-- "):
|