Example #1
0
 def _find_matching_scheme(cls, schemes: List[str], reference_name: str) -> str:
     return min(schemes, key=lambda scheme: levenshtein_distance(reference_name, scheme))
def test_levenshtein_distance_on_all_operations(s1, s2, distance):
    assert levenshtein_distance(s1, s2) == distance
def test_levenshtein_distance_on_substitutions(s1, s2, distance):
    assert levenshtein_distance(s1, s2) == distance
def test_levenshtein_distance_on_removals(s1, s2, distance):
    assert levenshtein_distance(s1, s2) == distance
def test_levenshtein_distance_on_inserts(s1, s2, distance):
    assert levenshtein_distance(s1, s2) == distance
def test_levenshtein_distance_on_equal_strings(s1, s2, distance):
    assert levenshtein_distance(s1, s2) == distance