3 ms·
Rather than re-implement this it might be better to use an existing library. In Python, I've used pylevenshtein: http://code.google.com/p/pylevenshtein/ http:/
by mrshoe 17y ago
Rather than re-implement this it might be better to use an existing library. In Python, I've used pylevenshtein:
http://code.google.com/p/pylevenshtein/ http://code.google.com/p/pylevenshtein/
However, I've found the Jaro-Winkler distance to be more useful than the Levenshtein. You can find good implementations for Jaro out there as well.
http://en.wikipedia.org/wiki/Jaro-Winkler_distance http://en.wikipedia.org/wiki/Jaro-Winkler_distance
- raffi 17y agoThese algorithms solve a different problem. They calculate the edit distance between a string A and B. The algorithm in the post finds all strings B within an edit distance N of string A.