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 @@ -671,13 +671,13 @@ "sMessage": sMessage, "aSuggestions": lSugg, "URL": sURL } if bContext: - dErr['sUnderlined'] = self.sSentence0[nStart:nEnd] - dErr['sBefore'] = self.sSentence0[max(0,nStart-80):nStart] - dErr['sAfter'] = self.sSentence0[nEnd:nEnd+80] + dErr['sUnderlined'] = self.sText0[nStart:nEnd] + dErr['sBefore'] = self.sText0[max(0,nStart-80):nStart] + dErr['sAfter'] = self.sText0[nEnd:nEnd+80] return dErr def _expand (self, sText, nTokenOffset, nLastToken): for m in re.finditer(r"\\(-?[0-9]+)", sText): if m.group(1)[0:1] == "-": @@ -903,15 +903,15 @@ # all morph must match sPattern zPattern = re.compile(sPattern) return all(zPattern.search(sMorph) for sMorph in lMorph) else: zNegPattern = re.compile(sNegPattern) - if any(zNegPattern.search(s) for s in lMorph): + if any(zNegPattern.search(sMorph) for sMorph in lMorph): return False # search sPattern zPattern = re.compile(sPattern) - return any(zPattern.search(s) for s in lMorph) + return any(zPattern.search(sMorph) for sMorph in lMorph) def analyse (sWord, sPattern, sNegPattern=""): "analyse a word, returns True if not sNegPattern in word morphologies and sPattern in word morphologies (disambiguation off)" lMorph = _oSpellChecker.getMorph(sWord) @@ -922,15 +922,15 @@ if sNegPattern == "*": zPattern = re.compile(sPattern) return all(zPattern.search(sMorph) for sMorph in lMorph) else: zNegPattern = re.compile(sNegPattern) - if any(zNegPattern.search(s) for s in lMorph): + if any(zNegPattern.search(sMorph) for sMorph in lMorph): return False # search sPattern zPattern = re.compile(sPattern) - return any(zPattern.search(s) for s in lMorph) + return any(zPattern.search(sMorph) for sMorph in lMorph) #### Analyse tokens for graph rules def g_value (dToken, sValues, nLeft=None, nRight=None):