MiniLevenshtein
Simple, fast, levenshtein distance and similarity ratio for Ruby
Synopsis
MiniLevenshtein.edit_distance("levenshtein", "levenstien") # => 3
MiniLevenshtein.similarity("levenshtein", "levenstien") # 0.857142...
Why?
While there are many levenshtein distance implementations for Ruby, none provided a means to adjust edit scoring to make the calcuations suitable for a similarity ratio.
See Also
Credits
Ruby Bindings
Delon Newman [email protected]
Original C Code
- David Necas (Yeti) [email protected]
- Atakan Gurkan
- James Theiler
- Brian Gough
(see ext/mini_levenshtein/levenshtein.c for more)
License
The gem is available as open source under the terms of the GPL.