Grammalecte  Diff

Differences From Artifact [38ce8a200e]:

To Artifact [2560b5c98b]:


    30     30   def parseText (sText, dOptions=None, bFormatText=False, sError=""):
    31     31       "parse <sText> and return errors in a JSON format"
    32     32       sJSON = '{ "program": "grammalecte-fr", "version": "'+oGCE.version+'", "lang": "'+oGCE.lang+'", "error": "'+sError+'", "data" : [\n'
    33     33       sDataJSON = ""
    34     34       for i, sParagraph in enumerate(txt.getParagraph(sText), 1):
    35     35           if bFormatText:
    36     36               sParagraph = oTextFormatter.formatText(sParagraph)
    37         -        sResult = oGrammarChecker.generateParagraphAsJSON(i, sParagraph, dOptions=dOptions, bEmptyIfNoErrors=True, bReturnText=bFormatText)
           37  +        sResult = oGrammarChecker.getParagraphErrorsAsJSON(i, sParagraph, dOptions=dOptions, bEmptyIfNoErrors=True, bReturnText=bFormatText)
    38     38           if sResult:
    39     39               if sDataJSON:
    40     40                   sDataJSON += ",\n"
    41     41               sDataJSON += sResult
    42     42       sJSON += sDataJSON + "\n]}\n"
    43     43       return sJSON
    44     44