Skip to content

Simple, fast Levenshtein distance and similarity ratio for Ruby

License

Notifications You must be signed in to change notification settings

delonnewman/mini-levenshtein

Repository files navigation

Ruby

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 contact@delonnewman.name

Original C Code

(see ext/mini_levenshtein/levenshtein.c for more)

License

The gem is available as open source under the terms of the GPL.