Grammalecte  Check-in [7e80aa3aa5]

Overview
Comment:[cli] command update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | cli
Files: files | file ages | folders
SHA3-256: 7e80aa3aa5fc4858a417c4d700749756daa40034267141db293b79191dec2a25
User & Date: olr on 2019-05-26 08:17:00
Other Links: manifest | tags
Context
2019-05-26
08:21
[core][py] text: variable renaming check-in: 70e09b7bc9 user: olr tags: trunk, core
08:17
[cli] command update check-in: 7e80aa3aa5 user: olr tags: trunk, cli
08:12
[core] text: sentence splitter update check-in: f5dac644a7 user: olr tags: trunk, core
Changes

Modified grammalecte-cli.py from [bd4e7bba73] to [54a739402e].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
_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)
    >>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
    /o- option1 [option2] ...           deactivate grammar checking options







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
_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)
    $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
    /o- option1 [option2] ...           deactivate grammar checking options
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
                sFilter = sText[sText.find(" "):].strip()  if " " in sText  else None
                oGrammarChecker.gce.displayRules(sFilter)
            elif sText in ("/quit", "/q"):
                break
            elif sText.startswith("/rl"):
                # reload (todo)
                pass
            elif sText.startswith(">>"):
                for sParagraph in txt.getParagraph(sText):
                    sText = sText[2:]
                    if xArgs.textformatter:
                        sText = oTextFormatter.formatText(sParagraph)
                    lParagraphErrors, lSentences = oGrammarChecker.gce.parse(sText, bDebug=xArgs.debug, bFullInfo=True)
                    echo(txt.getReadableErrors(lParagraphErrors, xArgs.width))
                    for dSentence in lSentences:
                        echo("{nStart}:{nEnd}".format(**dSentence))
                        echo("   <" + dSentence["sSentence"]+">")







|

|







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
                sFilter = sText[sText.find(" "):].strip()  if " " in sText  else None
                oGrammarChecker.gce.displayRules(sFilter)
            elif sText in ("/quit", "/q"):
                break
            elif sText.startswith("/rl"):
                # reload (todo)
                pass
            elif sText.startswith("$"):
                for sParagraph in txt.getParagraph(sText):
                    sText = sText[1:]
                    if xArgs.textformatter:
                        sText = oTextFormatter.formatText(sParagraph)
                    lParagraphErrors, lSentences = oGrammarChecker.gce.parse(sText, bDebug=xArgs.debug, bFullInfo=True)
                    echo(txt.getReadableErrors(lParagraphErrors, xArgs.width))
                    for dSentence in lSentences:
                        echo("{nStart}:{nEnd}".format(**dSentence))
                        echo("   <" + dSentence["sSentence"]+">")