question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Distance is one too small if first string is longer

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gfairchildcommented, Jul 27, 2020

This is now fixed in 1.6.1, which is live on PyPI. Thanks a bunch, @svenski!

0reactions
gfairchildcommented, Jul 27, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found