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: build, core, fr, trunk
13:48
[cli] clear text beginning by TEST: check-in: b5ba52c145 user: olr tags: cli, trunk
2021-01-06
21:58
[fr] ajustements check-in: e84d82b3a7 user: olr tags: fr, trunk
Changes

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

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