Distance is one too small if first string is longer
See original GitHub issueI looked through the existing bugs and the documentation and didn’t see anything pointing this out. I was also unable to reproduce this with your reference python implementation here
$ python3 -m pip show pyxdameraulevenshtein
Name: pyxDamerauLevenshtein
Version: 1.6
Summary: pyxDamerauLevenshtein implements the Damerau-Levenshtein (DL) edit distance algorithm for Python in Cython for high performance.
Home-page: https://github.com/gfairchild/pyxDamerauLevenshtein
Author: Geoffrey Fairchild
Author-email: mail@gfairchild.com
License: BSD 3-Clause License
Location: /usr/local/lib/python3.7/site-packages
Requires: numpy
Required-by:
>>> from pyxdameraulevenshtein import damerau_levenshtein_distance
>>> damerau_levenshtein_distance('1', '')
0
>>> damerau_levenshtein_distance('', '1')
1
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Check if edit distance between two strings is one
A Simple Solution is to find Edit Distance using Dynamic programming. If ... 3) Start traversing both strings from first character. a) If ......
Read more >Levenshtein distance - Wikipedia
In information theory, linguistics, and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences.
Read more >Find minimum edit distance between given two strings
In this method, we use bottom up approach to compute the edit distance between str1 and str2. We start by computing edit distance...
Read more >How can I find the best fit subsequences of a large string?
This seems to work well for the case that the substrings are shorter than the substrings produced by the original large string, but...
Read more >The Levenshtein Algorithm - Cuelogic An LTI Company
The Levenshtein distance can also be computed between two longer strings. But the cost to compute it, which is roughly proportional to the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now fixed in 1.6.1, which is live on PyPI. Thanks a bunch, @svenski!
This is really great, @svenski. I appreciate the PR. As you can see, I just haven’t been able to get around to fixing this myself unfortunately. I’ll review this shortly.