This plugin adds helpful methods on the texts. Here are the followings methods available.
-
Calculating the Levenshtein distance
Calculating the Levenshtein distance
String.levenshtein("str1", "str2") => 1 String.levenshtein("str1", "str1") => 0 String.levenshtein("str1", "str11") => 1 "str".levenshtein_with("test42") => 2
By default, case sensitive if activated. It’s possible to deactivated by passing case_sensitive => false as third argument
String.levenshtein("str1", "str11", :case_sensitive => false)
If you discover any bugs or want to drop a line, feel free to create an issue on GitHub.
Copyright © 2010 Florian Bertholin ([email protected]), released under the MIT license