Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann committed Nov 1, 2023
1 parent 35d3b9e commit 4a8d6bb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_hypothesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):


def jaro_similarity(P, T):
P_flag = [0] * (len(P) + 1)
T_flag = [0] * (len(T) + 1)
if not P and not T:
return 1.0

P_flag = [False] * (len(P) + 1)
T_flag = [False] * (len(T) + 1)

Bound = max(len(P), len(T)) // 2
Bound = max(Bound - 1, 0)
Expand All @@ -23,8 +26,8 @@ def jaro_similarity(P, T):

for j in range(lowlim, hilim + 1):
if not P_flag[j] and P[j] == T[i]:
T_flag[i] = 1
P_flag[j] = 1
T_flag[i] = True
P_flag[j] = True
CommonChars += 1
break

Expand Down

0 comments on commit 4a8d6bb

Please sign in to comment.