Index: compile_rules_graph.py ================================================================== --- compile_rules_graph.py +++ compile_rules_graph.py @@ -141,13 +141,13 @@ aAction = createAction(sActionId, sAction, nPriority, dOptPriority, len(lToken), dPos) if aAction: dACTIONS[sActionId] = aAction lResult = list(lToken) lResult.extend(["##"+str(iLine), sActionId]) - if iLine == 13341: - print(" ".join(lToken)) - print(sActionId, aAction) + #if iLine == 13341: + # print(" ".join(lToken)) + # print(sActionId, aAction) yield lResult else: print(" # Error on action at line:", iLine) print(sTokenLine, "\n", sActions) @@ -402,17 +402,17 @@ #sJSCallables = "// generated code, do not edit\nconst oEvalFunc = {\n" for sFuncName, sReturn in dFUNCTIONS.items(): if sFuncName.startswith("_g_cond_"): # condition sParams = "lToken, nTokenOffset, nLastToken, sCountry, bCondMemo, dTags, sSentence, sSentence0" elif sFuncName.startswith("g_msg_"): # message - sParams = "lToken, nTokenOffset" + sParams = "lToken, nTokenOffset, nLastToken" elif sFuncName.startswith("_g_sugg_"): # suggestion sParams = "lToken, nTokenOffset, nLastToken" elif sFuncName.startswith("_g_tp_"): # text preprocessor - sParams = "lToken, nTokenOffset" + sParams = "lToken, nTokenOffset, nLastToken" elif sFuncName.startswith("_g_da_"): # disambiguator - sParams = "lToken, nTokenOffset" + sParams = "lToken, nTokenOffset, nLastToken" else: print("# Unknown function type in [" + sFuncName + "]") continue sPyCallables += "def {} ({}):\n".format(sFuncName, sParams) sPyCallables += " return " + sReturn + "\n" Index: gc_core/py/lang_core/gc_engine.py ================================================================== --- gc_core/py/lang_core/gc_engine.py +++ gc_core/py/lang_core/gc_engine.py @@ -805,11 +805,11 @@ bChange = True elif cActionType == "=": # disambiguation if bDebug: print(" DISAMBIGUATOR:\n ", dRule[sRuleId]) - globals()[sWhat](self.lToken, nTokenOffset) + globals()[sWhat](self.lToken, nTokenOffset, nLastToken) elif cActionType == ">": # we do nothing, this test is just a condition to apply all following actions if bDebug: print(" COND_OK: ", sRuleId) pass @@ -864,11 +864,11 @@ else: lSugg = self._expand(sSugg, nTokenOffset, nLastToken).split("|") if bCaseSvty and lSugg and self.lToken[iFirstToken]["sValue"][0:1].isupper(): lSugg = list(map(lambda s: s[0:1].upper()+s[1:], lSugg)) # Message - sMessage = globals()[sMsg[1:]](self.lToken, nTokenOffset) if sMsg[0:1] == "=" else self._expand(sMsg, nTokenOffset, nLastToken) + sMessage = globals()[sMsg[1:]](self.lToken, nTokenOffset, nLastToken) if sMsg[0:1] == "=" else self._expand(sMsg, nTokenOffset, nLastToken) if bShowRuleId: sMessage += " " + sLineId + " # " + sRuleId # if _bWriterError: xErr = SingleProofreadingError() # uno.createUnoStruct( "com.sun.star.linguistic2.SingleProofreadingError" ) @@ -936,11 +936,11 @@ else: for i in range(nTokenRewriteStart, nTokenRewriteEnd+1): self.lToken[i]["sNewValue"] = "_" else: if sWhat.startswith("="): - sWhat = globals()[sWhat[1:]](self.lToken, nTokenOffset) + sWhat = globals()[sWhat[1:]](self.lToken, nTokenOffset, nLastToken) else: sWhat = self._expand(sWhat, nTokenOffset, nLastToken) bUppercase = bCaseSvty and self.lToken[nTokenRewriteStart]["sValue"][0:1].isupper() if nTokenRewriteEnd - nTokenRewriteStart == 0: # one token