Skip to content

Commit f102e07

Browse files
committed
tidy
1 parent c3a3c2e commit f102e07

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

fuzzymatcher/utils.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from metaphone import doublemetaphone
2-
import warnings
3-
42
from fuzzywuzzy.fuzz import ratio
53

6-
74
def tokens_to_dmetaphones(tokens):
85
new_tokens = []
96
for t in tokens:
@@ -43,13 +40,7 @@ def is_mispelling(token_left, token_right):
4340
if len(dml.intersection(dmr).difference({''})) > 0:
4441
return True
4542

46-
if levenshtein_installed:
47-
this_ratio = ratio(token_left, token_right)
48-
else:
49-
sm = SequenceMatcher(None, "hi", "hit")
50-
this_ratio = sm.ratio(token_left, token_right)
51-
52-
if this_ratio >= 90:
43+
if ratio(token_left, token_right) >= 90:
5344
return True
5445

5546
return False

0 commit comments

Comments
 (0)