Add class attribute for levenshtein ratio
Specific string object for artist names and song titles.
Here follows some class variables for regex to run on strings.
"""
Specific string object for artist names and song titles.
Here follows some class variables for regex to run on strings.
"""
+ diafilter = True
+ leven_ratio = 0.82
regexp_dict = dict()
# Leading patterns: The Le Les
regexp_dict = dict()
# Leading patterns: The Le Les
self.stripped = str(fuzzstr.strip())
# fuzzy computation
self._get_root()
self.stripped = str(fuzzstr.strip())
# fuzzy computation
self._get_root()
- self.remove_diacritics()
+ if self.__class__.diafilter:
+ self.remove_diacritics()
def __new__(cls, fuzzstr):
return super(SimaStr, cls).__new__(cls, fuzzstr)
def __new__(cls, fuzzstr):
return super(SimaStr, cls).__new__(cls, fuzzstr)
other.stripped.lower())
if hash(self) == hash(other):
return True
other.stripped.lower())
if hash(self) == hash(other):
return True
+ return levenr >= self.__class__.leven_ratio
def __ne__(self, other):
if not isinstance(other, SimaStr):
def __ne__(self, other):
if not isinstance(other, SimaStr):