Grammalecte  Check-in [4e38c87cf8]

Overview
Comment:[cli] new command: @@ for full analysis
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | cli
Files: files | file ages | folders
SHA3-256: 4e38c87cf868fc8cf16fd638ba2467c8346bfa16e7ab98258748f03d937f82cd
User & Date: olr on 2019-05-25 10:20:32
Other Links: manifest | tags
Context
2019-05-25
10:22
[cli] update doc check-in: 60164f9472 user: olr tags: cli, trunk
10:20
[cli] new command: @@ for full analysis check-in: 4e38c87cf8 user: olr tags: cli, trunk
10:08
[core][py] gc engine: full analysis, results with sentences, tokens and errors check-in: 391d4d820a user: olr tags: core, trunk
Changes

Modified grammalecte-cli.py from [b9b88866b3] to [03fd556d3c].

   256    256                   sFilter = sText[sText.find(" "):].strip()  if " " in sText  else None
   257    257                   oGrammarChecker.gce.displayRules(sFilter)
   258    258               elif sText in ("/quit", "/q"):
   259    259                   break
   260    260               elif sText.startswith("/rl"):
   261    261                   # reload (todo)
   262    262                   pass
          263  +            elif sText.startswith("@@"):
          264  +                for sParagraph in txt.getParagraph(sText):
          265  +                    if xArgs.textformatter:
          266  +                        sText = oTextFormatter.formatText(sParagraph)
          267  +                    for dSentence in oGrammarChecker.gce.parse(sText[2:], bDebug=xArgs.debug, bFullInfo=True):
          268  +                        echo("{nStart}:{nEnd}".format(**dSentence))
          269  +                        echo("   <" + dSentence["sSentence"]+">")
          270  +                        for dToken in dSentence["lToken"]:
          271  +                            print("    {0[nStart]:>3}:{0[nEnd]:<3} {1} {0[sType]:<14} {0[sValue]:<16} {2:<10}   {3}".format(dToken, \
          272  +                                                                                                            "×" if dToken.get("bToRemove", False) else " ",
          273  +                                                                                                            " ".join(dToken.get("lMorph", "")), \
          274  +                                                                                                            "·".join(dToken.get("aTags", "")) ) )
          275  +                            #print(dToken)
   263    276               else:
   264    277                   for sParagraph in txt.getParagraph(sText):
   265    278                       if xArgs.textformatter:
   266    279                           sText = oTextFormatter.formatText(sParagraph)
   267    280                       sRes = oGrammarChecker.generateParagraph(sParagraph, bEmptyIfNoErrors=xArgs.only_when_errors, nWidth=xArgs.width, bDebug=xArgs.debug)
   268    281                       if sRes:
   269    282                           echo("\n" + sRes)