Index: gc_lang/fr/modules-js/lexicographe.js ================================================================== --- gc_lang/fr/modules-js/lexicographe.js +++ gc_lang/fr/modules-js/lexicographe.js @@ -331,11 +331,11 @@ } let nPos = s.indexOf("-"); return _dAD.get(s.slice(0, nPos)) + " +" + _dAD.get(s.slice(nPos + 1)); } - getListOfTokens (sText, bInfo = true) { + getListOfTokens (sText, bInfo=true) { let aElem = []; if (sText !== "") { for (let oToken of this.oTokenizer.genTokens(sText)) { if (bInfo) { let aRes = this.getInfoForToken(oToken); @@ -348,11 +348,11 @@ } } return aElem; } - getListOfTokensReduc (sText, bInfo = true) { + getListOfTokensReduc (sText, bInfo=true) { let aTokenList = this.getListOfTokens(sText.replace("'", "’").trim(), false); let iKey = 0; let aElem = []; do { let oToken = aTokenList[iKey]; @@ -379,14 +379,13 @@ if (sMorphLoc) { let sWord = ''; for (let oTokenWord of aTokenTempList) { sWord += oTokenWord.sValue+' '; } - iKey = iKey + aTokenTempList.length-1; let oTokenLocution = { - 'nEnd': aTokenTempList[aTokenTempList.length-1].nEnd, 'nStart': aTokenTempList[0].nStart, + 'nEnd': aTokenTempList[aTokenTempList.length-1].nEnd, 'sType': "LOC", 'sValue': sWord.replace('’ ','’').trim() }; if (bInfo) { let aFormatedTag = []; @@ -399,25 +398,26 @@ aLabel: aFormatedTag }); } else { aElem.push(oTokenLocution); } + iKey = iKey + aTokenTempList.length; } else { if (bInfo) { let aRes = this.getInfoForToken(oToken); if (aRes) { aElem.push(aRes); } } else { aElem.push(oToken); } + iKey++; } - iKey++; } while (iKey < aTokenList.length); return aElem; } } if (typeof(exports) !== 'undefined') { exports.Lexicographe = Lexicographe; }