Skip to content
Fuzzy string search
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
README.md
Rakefile
scorerb.gemspec

README.md

Scorerb

Scorerb is a fuzzy string search algorithm.

Build Status Stable on ruby ~> 1.9.2, need more tests under other versions

What it does

  • 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

How to use it

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"

Options

String

    "Hello".score "He", fuzzines = 0 

Array

    [1,2,3].score "1", :fuzz => 0, :to_s => false 

Credits

It's based on the string_score from Joshaven Potter.

Checkout the C# version also at ScoreSharp

You can’t perform that action at this time.