Ruby library for phonetic algorithms. It supports Soundex, Metaphone, Double Metaphone, Caverphone, NYSIIS and others.
Add this line to your application's Gemfile:
gem 'phonetic'
And then execute:
$ bundle
Or install it yourself as:
$ gem install phonetic
Ruby >= 1.9, JRuby 1.7.6, Rubinius 2.1.1
require 'phonetic'
'Ackerman'.soundex # => 'A265'
'ammonium'.soundex # => 'A500'
'implementation'.soundex # => 'I514'
'Caren'.refined_soundex # => 'C30908'
'Hayers'.refined_soundex # => 'H093'
'Lambard'.refined_soundex # => 'L7081096'
'Accola'.metaphone # => 'AKKL'
'Nikki'.metaphone # => 'NK'
'Wright'.metaphone #=> 'RT'
'czerny'.double_metaphone # => ['SRN', 'XRN']
'dumb'.double_metaphone # => ['TM', 'TM']
'edgar'.double_metaphone # => ['ATKR', 'ATKR']
or use alias:
'czerny'.metaphone2 # => ['SRN', 'XRN']
'dumb'.metaphone2 # => ['TM', 'TM']
'edgar'.metaphone2 # => ['ATKR', 'ATKR']
'Lashaunda'.caverphone # => 'LSNT11'
'Vidaurri'.caverphone # => 'FTR111'
'Stevenson'.caverphone2 # => 'STFNSN1111'
'Peter'.caverphone2 # => 'PTA1111111'
'Alexandra'.nysiis # => 'ALAXANDR'
'Aumont'.nysiis # => 'AANAD'
'Bonnie'.nysiis # => 'BANY'
'Aumont'.refined_nysiis # => 'ANAD'
'Phoenix'.refined_nysiis # => 'FANAC'
'Schmidt'.refined_nysiis # => 'SNAD'
'Anja'.dm_soundex # => ['060000', '064000']
'Schwarz'.dm_soundex # => ['474000', '479400']
'Schtolteheim'.dm_soundex # => ['283560']
- Fork it
- 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 new Pull Request