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
Upgrade Levenshtein to Damerau-Levenshtein #1973
Conversation
Allow for transpositions
Upgrade levenshtein to damerau-levenshtein
@thrien thanks for the contribution 👏 , this code certainly hasn't been touched in a long time. |
@thrien tests are failing due to a slight drop in coverage, it looks like line 57 of the new algorithm isn't exercised. Could we add a test case? |
Line 57 is the new case that counts as one edit (transposition). So it makes sense that it doesn't get tested. I will try to add a test, even though i don't really know how tests work. |
@thrien thank you for the contribution 👏 |
Thanks @thrien! |
Minor improvement for convenience. The Damerau-Levenshtein distance considers transpositions (which are common in mistyped strings) as one edit.