Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update rapidfuzz #83

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'numpy', # for SmithWaterman and other
'python-Levenshtein', # for Jaro and Levenshtein
'pyxDamerauLevenshtein', # for DamerauLevenshtein
'rapidfuzz>=2.0.0', # for Jaro, Levenshtein and other
'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other
],

# needed for benchmarking, optimization and testing
Expand All @@ -23,7 +23,7 @@
'numpy',
'python-Levenshtein',
'pyxDamerauLevenshtein',
'rapidfuzz>=2.0.0',
'rapidfuzz>=2.6.0',
# slow
'distance',
'pylev',
Expand All @@ -40,26 +40,27 @@

# for algos, from fastest to slowest, only faster than textdistance:
'DamerauLevenshtein': [
'rapidfuzz>=2.6.0', # any iterators of hashable elements
'jellyfish', # only for text
'pyxDamerauLevenshtein', # for any iterators
],
'Hamming': [
'python-Levenshtein', # only same length and strings
'rapidfuzz>=2.0.0', # only same length, any iterators of hashable elements
'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements
'jellyfish', # only strings, any length
'distance', # only same length, any iterators
'abydos', # any iterators
],
'Jaro': [
'rapidfuzz>=2.0.0', # any iterators of hashable elements
'rapidfuzz>=2.6.0', # any iterators of hashable elements
'python-Levenshtein', # only text
],
'JaroWinkler': [
'rapidfuzz>=2.0.0', # any iterators of hashable elements
'rapidfuzz>=2.6.0', # any iterators of hashable elements
'jellyfish', # only text
],
'Levenshtein': [
'rapidfuzz>=2.0.0', # any iterators of hashable elements
'rapidfuzz>=2.6.0', # any iterators of hashable elements
'python-Levenshtein', # only text
# yeah, other libs slower than textdistance
],
Expand Down
4 changes: 4 additions & 0 deletions textdistance/libraries.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"DamerauLevenshtein": [
[
"rapidfuzz.distance.DamerauLevenshtein",
"distance"
],
[
"jellyfish",
"damerau_levenshtein_distance"
Expand Down
1 change: 1 addition & 0 deletions textdistance/libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class SameLengthTextLibrary(SameLengthLibrary, TextLibrary):
prototype.register('DamerauLevenshtein', LibraryBase('abydos.distance', 'DamerauLevenshtein'))
prototype.register('DamerauLevenshtein', LibraryBase('pyxdameraulevenshtein', 'damerau_levenshtein_distance'))
prototype.register('DamerauLevenshtein', TextLibrary('jellyfish', 'damerau_levenshtein_distance'))
prototype.register('DamerauLevenshtein', LibraryBase('rapidfuzz.distance.DamerauLevenshtein', 'distance'))

prototype.register('Hamming', LibraryBase('abydos.distance', 'Hamming'))
prototype.register('Hamming', SameLengthLibrary('distance', 'hamming'))
Expand Down