Spaces:
Runtime error
Runtime error
Updating module
Browse files- levenshtein_distance.py +1 -1
levenshtein_distance.py
CHANGED
@@ -77,7 +77,7 @@ def _dist(A, B, insertion, deletion, substitution):
|
|
77 |
def levenshtein_distance(l1, l2, normalize=False):
|
78 |
dist = _dist(l1, l2, 1, 1, 1)[-1][-1]
|
79 |
if normalize:
|
80 |
-
return
|
81 |
else:
|
82 |
return dist
|
83 |
|
|
|
77 |
def levenshtein_distance(l1, l2, normalize=False):
|
78 |
dist = _dist(l1, l2, 1, 1, 1)[-1][-1]
|
79 |
if normalize:
|
80 |
+
return dist / max(len(l1), len(l2))
|
81 |
else:
|
82 |
return dist
|
83 |
|