Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgrade dependencies, remove Levenshtein unicode hack
  • Loading branch information
maxharlow committed Jun 29, 2019
1 parent b35601a commit 6b49781
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions fuzzylevenshtein.py
@@ -1,13 +1,6 @@
import jellyfish
import jellyfish._jellyfish as py_jellyfish

def match(value1, value2):
maximum = float(max(len(value1), len(value2)))
distance = damerau_levenshtein_distance(value1, value2)
distance = jellyfish.damerau_levenshtein_distance(value1, value2)
return 1 - distance / maximum

def damerau_levenshtein_distance(a, b):
try:
return jellyfish.damerau_levenshtein_distance(a, b)
except ValueError: # c implementation can't deal with unicode, fall back to (slower) python
return py_jellyfish.damerau_levenshtein_distance(a, b)
8 changes: 4 additions & 4 deletions setup.py
Expand Up @@ -14,10 +14,10 @@
install_requires=[
'chardet==3.0.4',
'tqdm==4.18.0',
'colorama==0.3.9',
'unidecode==1.0.22',
'dedupe==1.9.2',
'jellyfish==0.6.1',
'colorama==0.4.1',
'unidecode==1.0.23',
'dedupe==1.9.7',
'jellyfish==0.7.2',
'doublemetaphone==0.1'
],
entry_points = {
Expand Down

0 comments on commit 6b49781

Please sign in to comment.