Collection of text algorithms. gem install text
= Text
A collection of text algorithms.
== Usage
require 'text'
=== Levenshtein distance
Text::Levenshtein.distance('test', 'test')
Text::Levenshtein.distance('test', 'tent')
Text::Levenshtein.distance('test', 'testing')
Text::Levenshtein.distance('test', 'testing', 2)
=== Metaphone
Text::Metaphone.metaphone('BRIAN')
Text::Metaphone.double_metaphone('Coburn')
Text::Metaphone.double_metaphone('Angier')
=== Soundex
Text::Soundex.soundex('Knuth')
=== Porter stemming
Text::PorterStemming.stem('abatements') # => 'abat'
=== White similarity
white = Text::WhiteSimilarity.new white.similarity('Healed', 'Sealed') # 0.8 white.similarity('Healed', 'Help') # 0.25
Note that some intermediate information is cached on the instance to improve performance.
== Ruby version compatibility
The library has been tested on Ruby 1.8.6 to 1.9.3 and on JRuby.
== Thanks
== License
MIT. See COPYING.txt for details.
No open issues yet, or sync has not completed.