Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

RubyFish is a ruby port of python library jellyfish (http://github.com/sunlightlabs/jellyfish) for doing approximate and phonetic matching of strings

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib v0.0.6 August 13, 2013
Octocat-spinner-32 spec Fix bug in DamerauLevenshtein transposition logic August 12, 2013
Octocat-spinner-32 .gitignore Initial commit. September 20, 2010
Octocat-spinner-32 CHANGELOG.md Initial commit. September 20, 2010
Octocat-spinner-32 Gemfile Update gems August 16, 2012
Octocat-spinner-32 Gemfile.lock Update dev dependencies August 13, 2013
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 ROADMAP.md Update README and ROUDMAP September 20, 2010
Octocat-spinner-32 Rakefile User bundler tasks for gem management August 16, 2012
Octocat-spinner-32 rubyfish.gemspec Add description to gem September 20, 2010
README.md

RubyFish

RubyFish is a ruby port of python library jellyfish for doing approximate and phonetic matching of strings.


RubyFish is a project of AnjLab (c) 2010. All code is released under a BSD-style license, see LICENSE for details.

Originally written by Michael Stephens and James Turk.

Ported by Yury Korolev Source is available on GitHub

Included Algorithms

String comparison:

  • Levenshtein Distance
  • Damerau-Levenshtein Distance
  • Jaro Distance
  • Jaro-Winkler Distance
  • Hamming Distance
  • Longest Substring
  • Longest Subsequence

Phonetic encoding:

  • Double Metaphone

Example Usage

ruby-1.9.2-p0 > require 'rubyfish'
ruby-1.9.2-p0 > RubyFish::Levenshtein.distance("jellyfish", "rubyfish")
=> 4
ruby-1.9.2-p0 > RubyFish::Jaro.distance("jellyfish", "rubyfish")
=> 0.7268518518518519
ruby-1.9.2-p0 > RubyFish::DamerauLevenshtein.distance("rubyfish", "rubyfihs")
=> 1

ruby-1.9.2-p0 > RubyFish::DoubleMetaphone.phonetic_code "prived"
 => ["PRFT", nil] 
ruby-1.9.2-p0 > RubyFish::DoubleMetaphone.phonetic_code "privet"
 => ["PRFT", nil]
Something went wrong with that request. Please try again.