Note: This is now part of the Text project, hosted on RubyForge. For newer releases, visit Text on RubyForge.
The Levenshtein distance is a measure of how similar two strings s and t are, calculated as the number of deletions/insertions/substitutions needed to transform s into t. The greater the distance, the more the strings differ.
The Levenshtein distance is also sometimes referred to as the easier-to-pronounce-and-spell ‘edit distance’.
- 2005-05-19 1.3 Repairing an oversight, distance can now be called via
- 2005-05-04 1.2 Now uses just one 1-dimensional array. I think this is as far as optimisation can go.
- 2005-05-04 1.1 Now storing only the current and previous rows of the matrix instead of the whole lot.
Copyright © 2005 Paul Battley
Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
2005-07-26 15:22 UTC. Comments: 3.