def test_damerau_levenshtein_transposition(self): self.assertEqual(1, _helpers._damerau_levenshtein('kitten', 'ktiten'))
def test_damerau_levenshtein_empty(self): self.assertEqual(5, _helpers._damerau_levenshtein('', 'kites')) self.assertEqual(6, _helpers._damerau_levenshtein('kitten', ''))
def test_damerau_levenshtein_commutative(self): self.assertEqual(2, _helpers._damerau_levenshtein('kitten', 'kites')) self.assertEqual(2, _helpers._damerau_levenshtein('kites', 'kitten'))
def test_damerau_levenshtein_id(self): self.assertEqual(0, _helpers._damerau_levenshtein('asdf', 'asdf'))