Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Sep 20, 2024
1 parent b3cd932 commit f7d56fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def levenshtein_distance(reference_str: str, target_str: str) -> int:
for j in range(target_len):
deletion_cost = previous_row[j + 1] + 1
insertion_cost = current_row[j] + 1
substitution_cost = previous_row[j] if reference_str[i] == target_str[j] else previous_row[j] + 1
substitution_cost = (
previous_row[j]
if reference_str[i] == target_str[j]
else previous_row[j] + 1
)

current_row[j + 1] = min(deletion_cost, insertion_cost, substitution_cost)

Expand Down

0 comments on commit f7d56fd

Please sign in to comment.