def _eq(self, a, b, strict=False, match=None): """ Returns whether or not a fuzzily matches b """ a = unicode(a) b = unicode(b) if not strict: a = simplify(a) b = simplify(b) if len(a) > len(b): a, b = b, a if match == 'prefix': return b.startswith(a) if match == 'contains': return a in b return a == b
def matches(self, string): return simplify(self.__string) == simplify(string.lower())