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 @@ -413,14 +413,14 @@ echo(" MATCH: >" + sLemma) yield { "iNode1": iNode1, "dNode": dGraph[dNode[""][sLemma]] } bTokenFound = True # regex morph arcs if "" in dNode: + lMorph = dToken.get("lMorph", _oSpellChecker.getMorph(dToken["sValue"])) for sRegex in dNode[""]: if "¬" not in sRegex: # no anti-pattern - lMorph = dToken.get("lMorph", _oSpellChecker.getMorph(dToken["sValue"])) if any(re.search(sRegex, sMorph) for sMorph in lMorph): if bDebug: echo(" MATCH: @" + sRegex) yield { "iNode1": iNode1, "dNode": dGraph[dNode[""][sRegex]] } bTokenFound = True @@ -428,18 +428,16 @@ # there is an anti-pattern sPattern, sNegPattern = sRegex.split("¬", 1) if sNegPattern == "*": # all morphologies must match with if sPattern: - lMorph = dToken.get("lMorph", _oSpellChecker.getMorph(dToken["sValue"])) if lMorph and all(re.search(sPattern, sMorph) for sMorph in lMorph): if bDebug: echo(" MATCH: @" + sRegex) yield { "iNode1": iNode1, "dNode": dGraph[dNode[""][sRegex]] } bTokenFound = True else: - lMorph = dToken.get("lMorph", _oSpellChecker.getMorph(dToken["sValue"])) if sNegPattern and any(re.search(sNegPattern, sMorph) for sMorph in lMorph): continue if not sPattern or any(re.search(sPattern, sMorph) for sMorph in lMorph): if bDebug: echo(" MATCH: @" + sRegex)