Index: compile_rules_graph.py ================================================================== --- compile_rules_graph.py +++ compile_rules_graph.py @@ -56,10 +56,11 @@ sCode = re.sub(r"\bafter\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode) # after(sCode) sCode = re.sub(r"\bbefore0\(\s*", 'look(sSentence0[:lToken[1+nTokenOffset]["nStart"]], ', sCode) # before0(sCode) sCode = re.sub(r"\bafter0\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode) # after0(sCode) sCode = re.sub(r"\banalyseWord[(]", 'analyse(', sCode) sCode = re.sub(r"\bcheckAgreement[(]\\(\d+), *\\(\d+)", 'g_checkAgreement(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\2]', sCode) + sCode = re.sub(r"\bcheckAgreement[(]\\(\d+), *\\-(\d+)", 'g_checkAgreement(lToken[nTokenOffset+\\1], lToken[nLastToken-\\2+1]', sCode) sCode = re.sub(r"[\\](\d+)", 'lToken[nTokenOffset+\\1]["sValue"]', sCode) sCode = re.sub(r"[\\]-(\d+)", 'lToken[nLastToken-\\1+1]["sValue"]', sCode) sCode = re.sub(r">1", 'lToken[nLastToken+1]["sValue"]', sCode) sCode = re.sub(r"<1", 'lToken[nTokenOffset]["sValue"]', sCode) return sCode Index: gc_lang/fr/modules-js/gce_analyseur.js ================================================================== --- gc_lang/fr/modules-js/gce_analyseur.js +++ gc_lang/fr/modules-js/gce_analyseur.js @@ -32,22 +32,10 @@ return true; } if (bNotOnlyNames && !(cregex.mbAdj(lMorph2) || cregex.mbAdjNb(lMorph1))) { return false; } - return cregex.checkAgreement(lMorph1, lMorph2); -} - -function checkAgreement (sWord1, sWord2) { - let lMorph2 = _oSpellChecker.getMorph(sWord2); - if (lMorph2.length === 0) { - return true; - } - let lMorph1 = _oSpellChecker.getMorph(sWord1); - if (lMorph1.length === 0) { - return true; - } return cregex.checkAgreement(lMorph1, lMorph2); } function mbUnit (s) { if (/[µ\/⁰¹²³⁴⁵⁶⁷⁸⁹Ωℓ·]/.test(s)) { Index: gc_lang/fr/modules/gce_analyseur.py ================================================================== --- gc_lang/fr/modules/gce_analyseur.py +++ gc_lang/fr/modules/gce_analyseur.py @@ -27,21 +27,10 @@ lMorph2 = dToken2["lMorph"] if "lMorph" in dToken2 else _oSpellChecker.getMorph(dToken2["sValue"]) if not lMorph2: return True if bNotOnlyNames and not (cr.mbAdj(lMorph2) or cr.mbAdjNb(lMorph1)): return False - return cr.checkAgreement(lMorph1, lMorph2) - - -def checkAgreement (sWord1, sWord2): - "check agreement between and " - lMorph2 = _oSpellChecker.getMorph(sWord2) - if not lMorph2: - return True - lMorph1 = _oSpellChecker.getMorph(sWord1) - if not lMorph1: - return True return cr.checkAgreement(lMorph1, lMorph2) _zUnitSpecial = re.compile("[µ/⁰¹²³⁴⁵⁶⁷⁸⁹Ωℓ·]") _zUnitNumbers = re.compile("[0-9]")