Scorerb is a fuzzy string search algorithm.
Stable on ruby ~> 1.9.2, need more tests under other versions
- It tells how much a string matches another one
- It can sort your string arrays from the the best scored 'til the end
- It can't bring you a beer
It's simple:
- require it
require "scorerb"
- run bundle
bundle install
- And ask for the score
"Abc".score "A" # without fuzzines
"Abc".score "azb" 0.2 # with fuzzines (0..1) ["abc","AB","a"].score "A"
"Hello".score "He", fuzzines = 0
[1,2,3].score "1", :fuzz => 0, :to_s => false
It's based on the string_score from Joshaven Potter.
Checkout the C# version also at ScoreSharp