Index: gc_core/js/lang_core/gc_engine.js ================================================================== --- gc_core/js/lang_core/gc_engine.js +++ gc_core/js/lang_core/gc_engine.js @@ -1,7 +1,9 @@ // Grammar checker engine +//"use strict"; + ${string} ${regex} ${map} @@ -84,11 +86,11 @@ for (let [iStart, iEnd] of this._getSentenceBoundaries(sText)) { if (4 < (iEnd - iStart) < 2000) { dDA.clear(); //echo(sText.slice(iStart, iEnd)); try { - [_, errs] = this._proofread(sText.slice(iStart, iEnd), sAlt.slice(iStart, iEnd), iStart, false, dDA, dPriority, sCountry, bDebug, bContext); + [sNew, errs] = this._proofread(sText.slice(iStart, iEnd), sAlt.slice(iStart, iEnd), iStart, false, dDA, dPriority, sCountry, bDebug, bContext); dErrors.gl_update(errs); } catch (e) { helpers.logerror(e); } @@ -217,10 +219,11 @@ } else { oErr["aSuggestions"] = sRepl.gl_expand(m).split("|"); } } // Message + let sMessage = ""; if (sMsg[0] === "=") { sMessage = oEvalFunc[sMsg.slice(1)](s, m) } else { sMessage = sMsg.gl_expand(m); } @@ -278,19 +281,19 @@ }, listRules: function (sFilter=null) { // generator: returns tuple (sOption, sLineId, sRuleId) try { - for ([sOption, lRuleGroup] of this._getRules(true)) { - for ([_, _, sLineId, sRuleId, _, _] of lRuleGroup) { + for (let [sOption, lRuleGroup] of this._getRules(true)) { + for (let [x1, x2, sLineId, sRuleId, x3, x4] of lRuleGroup) { if (!sFilter || sRuleId.test(sFilter)) { yield [sOption, sLineId, sRuleId]; } } } - for ([sOption, lRuleGroup] of this._getRules(false)) { - for ([_, _, sLineId, sRuleId, _, _] of lRuleGroup) { + for (let [sOption, lRuleGroup] of this._getRules(false)) { + for (let [x1, x2, sLineId, sRuleId, x3, x4] of lRuleGroup) { if (!sFilter || sRuleId.test(sFilter)) { yield [sOption, sLineId, sRuleId]; } } } Index: gc_lang/fr/modules-js/gce_suggestions.js ================================================================== --- gc_lang/fr/modules-js/gce_suggestions.js +++ gc_lang/fr/modules-js/gce_suggestions.js @@ -17,12 +17,12 @@ if (tTags) { // we get the tense let aTense = new Set(); for (let sMorph of _dAnalyses.gl_get(sFlex, [])) { let m; - let zVerb = new RegExp (sStem+" .*?(:(?:Y|I[pqsf]|S[pq]|K))", "g"); - while (m = zVerb.exec(sMorph)) { + let zVerb = new RegExp (">"+sStem+" .*?(:(?:Y|I[pqsf]|S[pq]|K))", "g"); + while ((m = zVerb.exec(sMorph)) !== null) { // stem must be used in regex to prevent confusion between different verbs (e.g. sauras has 2 stems: savoir and saurer) if (m) { if (m[1] === ":Y") { aTense.add(":Ip"); aTense.add(":Iq"); Index: gc_lang/fr/modules/gce_suggestions.py ================================================================== --- gc_lang/fr/modules/gce_suggestions.py +++ gc_lang/fr/modules/gce_suggestions.py @@ -13,11 +13,11 @@ tTags = conj._getTags(sStem) if tTags: # we get the tense aTense = set() for sMorph in _dAnalyses.get(sFlex, []): # we don’t check if word exists in _dAnalyses, for it is assumed it has been done before - for m in re.finditer(sStem+" .*?(:(?:Y|I[pqsf]|S[pq]|K|P))", sMorph): + for m in re.finditer(">"+sStem+" .*?(:(?:Y|I[pqsf]|S[pq]|K|P))", sMorph): # stem must be used in regex to prevent confusion between different verbs (e.g. sauras has 2 stems: savoir and saurer) if m: if m.group(1) == ":Y": aTense.add(":Ip") aTense.add(":Iq")