def gen(): for p in pattern: (name, args, op) = p if name == "value": (v1, v2) = (args, deaccent(args)) if v1 != v2: yield "any_of", ( v1, v2, ), op else: yield p elif name == "any_of": def items(): for w in args: (v1, v2) = (w, deaccent(w)) if v1 != v2: yield v1 yield v2 else: yield v1 yield "any_of", list(items()), op else: yield p
def items(): for w in args: (v1, v2) = (w, deaccent(w)) if v1 != v2: yield v1 yield v2 else: yield v1
def test_lithuanian(self): assert deaccent("Šarūnas") == "Sarunas" assert deaccent("Kęstutis") == "Kestutis" assert deaccent("Ąžuolas") == "Azuolas"