Grammalecte  Diff

Differences From Artifact [e38688e9b2]:

To Artifact [2ab933f7e3]:


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
        console.error(e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
        postMessage(["error", e.message]);
    }
}

function parse (sText, sCountry, bDebug, bContext) {
    let aGrammErr = gc_engine.parse(sText, sCountry, bDebug, bContext);
    postMessage(["grammar_errors", {aGrammErr: JSON.stringify(aGrammErr)}]);
}

function parseAndSpellcheck (sText, sCountry, bDebug, bContext) {
    let aGrammErr = gc_engine.parse(sText, sCountry, bDebug, bContext);
    let aSpellErr = oTokenizer.getSpellingErrors(sText, oDict);
    postMessage(["spelling_and_grammar_errors", {aGrammErr: JSON.stringify(aGrammErr), aSpellErr: JSON.stringify(aSpellErr)}]);
}

function getOptions () {
    postMessage(["options", gc_engine.getOptions().gl_toString()]);
}

function getDefaultOptions () {







|





|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
        console.error(e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
        postMessage(["error", e.message]);
    }
}

function parse (sText, sCountry, bDebug, bContext) {
    let aGrammErr = gc_engine.parse(sText, sCountry, bDebug, bContext);
    postMessage(["grammar_errors", {aGrammErr: aGrammErr}]);
}

function parseAndSpellcheck (sText, sCountry, bDebug, bContext) {
    let aGrammErr = gc_engine.parse(sText, sCountry, bDebug, bContext);
    let aSpellErr = oTokenizer.getSpellingErrors(sText, oDict);
    postMessage(["spelling_and_grammar_errors", {aGrammErr: aGrammErr, aSpellErr: aSpellErr}]);
}

function getOptions () {
    postMessage(["options", gc_engine.getOptions().gl_toString()]);
}

function getDefaultOptions () {
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
        let aRes = null;
        for (let oToken of oTokenizer.genTokens(sText)) {
            aRes = oLxg.getInfoForToken(oToken);
            if (aRes) {
                aElem.push(aRes);
            }
        }
        postMessage(["tokens", JSON.stringify(aElem)]);
    }
    catch (e) {
        helpers.logerror(e);
        postMessage(["error", e.message]);
    }
    
}







|





|
<
200
201
202
203
204
205
206
207
208
209
210
211
212
213

        let aRes = null;
        for (let oToken of oTokenizer.genTokens(sText)) {
            aRes = oLxg.getInfoForToken(oToken);
            if (aRes) {
                aElem.push(aRes);
            }
        }
        postMessage(["tokens", aElem]);
    }
    catch (e) {
        helpers.logerror(e);
        postMessage(["error", e.message]);
    }
}