Example #1
0
 def test_levenshtein(self):
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmno") == 0
     assert levenshtein("abcdef ghijk lmnop", "abcdef ghijk lmno") == 1
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmn") == 1
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmnp") == 1
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmnq") == 1
     assert levenshtein("cbcdef ghijk lmno", "abcdef ghijk lmnq") == 2
     assert levenshtein("cbcdef ghihk lmno", "abcdef ghijk lmnq") == 3
Example #2
0
 def test_levenshtein(self):
     self.assertEqual(levenshtein("abcdef ghijk lmno", "abcdef ghijk lmno"), 0)
     self.assertEqual(levenshtein("abcdef ghijk lmnop", "abcdef ghijk lmno"), 1)
     self.assertEqual(levenshtein("abcdef ghijk lmno", "abcdef ghijk lmn"), 1)
     self.assertEqual(levenshtein("abcdef ghijk lmno", "abcdef ghijk lmnp"), 1)
     self.assertEqual(levenshtein("abcdef ghijk lmno", "abcdef ghijk lmnq"), 1)
     self.assertEqual(levenshtein("cbcdef ghijk lmno", "abcdef ghijk lmnq"), 2)
     self.assertEqual(levenshtein("cbcdef ghihk lmno", "abcdef ghijk lmnq"), 3)
Example #3
0
 def test_levenshtein(self):
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmno") == 0
     assert levenshtein("abcdef ghijk lmnop", "abcdef ghijk lmno") == 1
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmn") == 1
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmnp") == 1
     assert levenshtein("abcdef ghijk lmno", "abcdef ghijk lmnq") == 1
     assert levenshtein("cbcdef ghijk lmno", "abcdef ghijk lmnq") == 2
     assert levenshtein("cbcdef ghihk lmno", "abcdef ghijk lmnq") == 3