def test_levenshtein_some_overlap(self): d = levenshtein("abc", "dcb") self.assertEqual(d, 3)
def test_levenshtein_on_words(self): d = levenshtein("i am a nice sentence".split(), "am i a new sentence".split()) self.assertEqual(d, 3)
def test_levenshtein_no_overlap(self): d = levenshtein("abc", "def") self.assertEqual(d, 3)
def test_levenshtein_identity(self): d = levenshtein("abc", "abc") self.assertEqual(d, 0)