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 @@ -617,11 +617,11 @@ let nTokenEnd = (eAct[1] > 0) ? nTokenOffset + eAct[1] : nLastToken + eAct[1]; this._tagAndPrepareTokenForRewriting(sWhat, nTokenStart, nTokenEnd, nTokenOffset, nLastToken, eAct[2], bDebug); bChange = true; if (bDebug) { console.log(` TEXT_PROCESSOR: ${sRuleId} ${sLineId}`); - console.log(` ${this.lToken[nTokenStart]["sValue"]} : ${this.lToken[nTokenEnd]["sValue"]} > ${sWhat}`); + console.log(` [${this.lToken[nTokenStart]["sValue"]}:${this.lToken[nTokenEnd]["sValue"]}] > ${sWhat}`); } } else if (cActionType == "=") { // disambiguation oEvalFunc[sWhat](this.lToken, nTokenOffset, nLastToken); @@ -805,13 +805,10 @@ return sText.slice(0, m.start[iGroup]) + sNew + sText.slice(m.end[iGroup]); } _tagAndPrepareTokenForRewriting (sWhat, nTokenRewriteStart, nTokenRewriteEnd, nTokenOffset, nLastToken, bCaseSvty, bDebug) { // text processor: rewrite tokens between and position - if (bDebug) { - console.log(" START: ${nTokenRewriteStart} - END: ${nTokenRewriteEnd} "); - } if (sWhat === "*") { // purge text if (nTokenRewriteEnd - nTokenRewriteStart == 0) { this.lToken[nTokenRewriteStart]["bToRemove"] = true; } else { @@ -878,11 +875,11 @@ console.log("REWRITE"); } let lNewToken = []; let nMergeUntil = 0; let dTokenMerger = null; - for (let [iToken, dToken] in this.lToken.entries()) { + for (let [iToken, dToken] of this.lToken.entries()) { let bKeepToken = true; if (dToken["sType"] != "INFO") { if (nMergeUntil && iToken <= nMergeUntil) { dTokenMerger["sValue"] += " ".repeat(dToken["nStart"] - dTokenMerger["nEnd"]) + dToken["sValue"]; dTokenMerger["nEnd"] = dToken["nEnd"]; @@ -1158,10 +1155,11 @@ return lMorph.some(sMorph => (sMorph.search(sPattern) !== -1)); } function g_analyse (dToken, sPattern, sNegPattern="", nLeft=null, nRight=null, bMemorizeMorph=true) { // analyse a token, return True if not in morphologies and in morphologies + let lMorph; if (nLeft !== null) { lMorph = _oSpellChecker.getMorph(dToken["sValue"].slice(nLeft, nRight)); if (bMemorizeMorph) { dToken["lMorph"] = lMorph; } @@ -1219,21 +1217,21 @@ function g_tag_before (dToken, dTags, sTag) { if (dTags.has(sTag)) { return false; } - if (dToken["i"] > dTags[sTag][0]) { + if (dToken["i"] > dTags.get(sTag)[0]) { return true; } return false; } function g_tag_after (dToken, dTags, sTag) { if (dTags.has(sTag)) { return false; } - if (dToken["i"] < dTags[sTag][1]) { + if (dToken["i"] < dTags.get(sTag)[1]) { return true; } return false; }