X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fsimastr.py;h=c7162144cd95cb3b3d65b793e3e18871ed16e220;hb=380d9fb347d1d367eb1a421f32c9ebce640c1639;hp=56cd2423a0474b540df2c4f010ee89f017585b0e;hpb=1d41464ccb6ff66441947eef0305518e3ce79a77;p=mpd-sima.git diff --git a/sima/lib/simastr.py b/sima/lib/simastr.py index 56cd242..c716214 100644 --- a/sima/lib/simastr.py +++ b/sima/lib/simastr.py @@ -101,13 +101,15 @@ class SimaStr(str): def __init__(self, fuzzstr): """ """ - super().__init__(fuzzstr) self.orig = str(fuzzstr) self.stripped = str(fuzzstr.strip()) # fuzzy computation self._get_root() self.remove_diacritics() + def __new__(cls, fuzzstr): + return super(SimaStr, cls).__new__(cls, fuzzstr) + def _get_root(self): """ Remove all patterns in string.