Index: darg.py ================================================================== --- darg.py +++ darg.py @@ -155,26 +155,31 @@ return self.__str__() == other.__str__() def getNodeAsDict (self): "returns the node as a dictionary structure" dNode = {} - dRegex = {} + dReValue = {} + dReMorph = {} dRules = {} dLemmas = {} for sArc, oNode in self.dArcs.items(): - if sArc.startswith("~") and len(sArc) > 1: - dRegex[sArc[1:]] = oNode.__hash__() + if sArc.startswith("~~") and len(sArc) > 2: + dReMorph[sArc[1:]] = oNode.__hash__() + elif sArc.startswith("~") and len(sArc) > 1: + dReValue[sArc[1:]] = oNode.__hash__() elif sArc.startswith(">") and len(sArc) > 1: dLemmas[sArc[1:]] = oNode.__hash__() elif sArc.startswith("##"): dRules[sArc[1:]] = oNode.__hash__() else: dNode[sArc] = oNode.__hash__() - if dRegex: - dNode[""] = dRegex + if dReValue: + dNode[""] = dReValue + il dReMorph: + dNode[""] = dReMorph if dLemmas: dNode[""] = dLemmas if dRules: dNode[""] = dRules #if self.bFinal: # dNode[""] = 1 return dNode 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 @@ -614,16 +614,21 @@ if sLemma in dNode[""]: yield dGraph[dNode[""][sLemma]] # universal arc if "*" in dNode: yield dGraph[dNode["*"]] - # regex arcs - if "" in dNode: - for sRegex in dNode["~"]: + # regex value arcs + if "" in dNode: + for sRegex in dNode[""]: + if re.search(sRegex, dToken["sValue"]): + yield dGraph[dNode[""][sRegex]] + # regex morph arcs + if "" in dNode: + for sRegex in dNode[""]: for sMorph in _oSpellChecker.getMorph(dToken["sValue"]): if re.search(sRegex, sMorph): - yield dGraph[dNode["regex"][sRegex]] + yield dGraph[dNode[""][sRegex]] def _executeActions (self, dNode, nOffset): for sLineId, nextNodeKey in dNode.items(): for sArc in dGraph[nextNodeKey]: print(sArc)