def test_change_1(self): s = 'foot' ss = [] for i in range(len(s) - 1): ss.extend(similar_change_2(s, i)) ss_d = [levenshteinDistance(s, i) for i in ss] print(ss_d)
def test_insert_0(self): s = 'foot' for i in range(len(s) + 1): ss = similar_insert(s, i) for j in ss: d = levenshteinDistance(j, s) self.assertEqual(d, 1)
def test_change_0(self): s = 'foot' for i in range(len(s)): ss = similar_change(s, i) for j in ss: if j != s: d = levenshteinDistance(j, s) self.assertEqual(d, 1)
def test_6(self): s1 = 'tnultiple' s2 = 'multiple' d = levenshteinDistance(s1, s2) self.assertEqual(d, 2)
def test_5(self): s1 = 'sting1' s2 = 'string1' d = levenshteinDistance(s1, s2) self.assertEqual(d, 1)