@@ -149,10 +149,24 @@ zPattern = re.compile(sPattern) return any(zPattern.search(sMorph) for sMorph in lMorph) #### Analyse tokens for graph rules + +def g_info (dToken): + "for debugging: retrieve info of word" + if not dToken: + echo("> no token") + return True + lMorph = dToken["lMorph"] if "lMorph" in dToken else _oSpellChecker.getMorph(dToken["sValue"]) + if not lMorph: + echo("> not in dictionary: " + dToken["sValue"]) + return True + for sKey, val in dToken.items(): + echo(sKey + ":" + str(val)) + return True + def g_value (dToken, sValues, nLeft=None, nRight=None): "test if is in sValues (each value should be separated with |)" sValue = "|"+dToken["sValue"]+"|" if nLeft is None else "|"+dToken["sValue"][slice(nLeft, nRight)]+"|" if sValue in sValues: