Grammalecte  Check-in [b5ba52c145]

Overview
Comment:[cli] clear text beginning by TEST:
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | cli
Files: files | file ages | folders
SHA3-256: b5ba52c145ec0c6f55554a3a01f7147647e26250a61dfcd6dbe0511610a16656
User & Date: olr on 2021-01-07 13:48:47
Other Links: manifest | tags
Context
2021-01-07
18:22
[build][core] new function: suggAgree() [fr] ajustements et nouvelles règles check-in: 101d54de7e user: olr tags: trunk, fr, core, build
13:48
[cli] clear text beginning by TEST: check-in: b5ba52c145 user: olr tags: trunk, cli
2021-01-06
21:58
[fr] ajustements check-in: e84d82b3a7 user: olr tags: trunk, fr
Changes

Modified grammalecte-cli.py from [4b02966a37] to [26cba906c4].

359
360
361
362
363
364
365




366
367
368
369
370
371
372
373
374
375
376
377
378
                                for dSubToken in dToken["lSubTokens"]:
                                    if dSubToken["sValue"]:
                                        echo("              · {0:20}".format(dSubToken["sValue"]))
                                        for sMorph, sLabel in zip(dSubToken["lMorph"], dSubToken["aLabels"]):
                                            echo("                {0:40}  {1}".format(sMorph, sLabel))
                        #echo(txt.getReadableErrors(dSentence["lGrammarErrors"], xArgs.width))
            else:




                for sParagraph in txt.getParagraph(sText):
                    if xArgs.textformatter:
                        sParagraph = oTextFormatter.formatText(sParagraph)
                    sRes, _ = oGrammarChecker.getParagraphWithErrors(sParagraph, bEmptyIfNoErrors=xArgs.only_when_errors, nWidth=xArgs.width, bDebug=xArgs.debug)
                    if sRes:
                        echo("\n" + sRes)
                    else:
                        echo("\nNo error found.")
            sText = _getText(sInputText)


if __name__ == '__main__':
    main()







>
>
>
>













359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
                                for dSubToken in dToken["lSubTokens"]:
                                    if dSubToken["sValue"]:
                                        echo("              · {0:20}".format(dSubToken["sValue"]))
                                        for sMorph, sLabel in zip(dSubToken["lMorph"], dSubToken["aLabels"]):
                                            echo("                {0:40}  {1}".format(sMorph, sLabel))
                        #echo(txt.getReadableErrors(dSentence["lGrammarErrors"], xArgs.width))
            else:
                if sText.startswith("TEST: "):
                    sText = sText[6:]
                    sText = sText.replace("{{", "").replace("}}", "")
                    sText = re.sub(" ->> .*$", "", sText).rstrip()
                for sParagraph in txt.getParagraph(sText):
                    if xArgs.textformatter:
                        sParagraph = oTextFormatter.formatText(sParagraph)
                    sRes, _ = oGrammarChecker.getParagraphWithErrors(sParagraph, bEmptyIfNoErrors=xArgs.only_when_errors, nWidth=xArgs.width, bDebug=xArgs.debug)
                    if sRes:
                        echo("\n" + sRes)
                    else:
                        echo("\nNo error found.")
            sText = _getText(sInputText)


if __name__ == '__main__':
    main()