levenshtein-edit-distance | Real fast | Autocomplete library
kandi X-RAY | levenshtein-edit-distance Summary
kandi X-RAY | levenshtein-edit-distance Summary
Levenshtein edit distance. No cruft. Real fast.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of levenshtein-edit-distance
levenshtein-edit-distance Key Features
levenshtein-edit-distance Examples and Code Snippets
Community Discussions
Trending Discussions on levenshtein-edit-distance
QUESTION
I have to normalize the Levenshtein distance between 0 to 1. I see different variations floating in SO.
I am thinking to adopt the following approach:
- if two strings, s1 and s2
- len = max(s1.length(), s2.length());
- normalized_distance = float(len - levenshteinDistance(s1, s2)) / float(len);
Then the highest score 1.0 means an exact match and 0.0 means no match.
But I see variations here: two whole texts similarity using levenshtein distance where 1- distance(a,b)/max(a.length, b.length)
Difference in normalization of Levenshtein (edit) distance?
Explanation of normalized edit distance formula
I am wondering is there a canonical code implementation in Java? I know org.apache.commons.text
only implements LevenshteinDistance and not normalized LevenshteinDistance.
ANSWER
Answered 2020-Sep-29 at 06:11Your first answer begins with "The effects of both variants should be nearly the same". The reason normalized LevenshteinDistance doesn't exist is because you (or somebody else) hasn't seen fit to implement it. Besides, it seems a rather trivial once you have the Levenshtein distance:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install levenshtein-edit-distance
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page