A ruby gem wrapper for cjellyfish: https://github.com/sunlightlabs/jellyfish , for doing approximate and phonetic matching of strings.
Add this line to your application's Gemfile:
gem 'jellyfish'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jellyfish
require 'jellyfish'
# include in your class
include JellyFish
levenshtein_distance('jellyfish', 'smellyfish')
jaro_distance('jellyfish', 'smellyfish')
metaphone('Jellyfish')
# stemmer
stemmer = JellyFish::Stemmer.new
# or after included
stemmer = Stemmer.new
stemmer.stem "riding"
stemmer.stem "fish"
- Fork it ( https://github.com/gihnius/jellyfish/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request