1 # -*- coding: utf-8 -*-
5 import sima.lib.simastr
8 def fuzzystr(sta, stb):
9 afz = sima.lib.simastr.SimaStr(sta)
10 bfz = sima.lib.simastr.SimaStr(stb)
15 class TestSequenceFunctions(unittest.TestCase):
17 def test_fuzzystr(self):
18 sima.lib.simastr.SimaStr.diafilter = False
19 self.assertFalse(fuzzystr('eeee', 'éééé'))
21 ('eeee', 'éééé', self.assertTrue),
22 ('The Doors', 'Doors', self.assertTrue),
23 ('Tigres Del Norte', 'Los Tigres Del Norte', self.assertTrue),
24 ( 'The Desert Sessions & PJ Harvey',
25 'Desert Sessions And PJ Harvey',
29 sima.lib.simastr.SimaStr.diafilter = True
30 for sta, stb, assertfunc in tests:
31 assertfunc(fuzzystr(sta, stb), '"{0}" == "{1}"'.format(sta, stb))
33 # vim: ai ts=4 sw=4 sts=4 expandtab