359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
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:
|
>
>
>
>
|
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
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:
|