Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (17 sloc) 673 Bytes

Text

A collection of text algorithms.

Usage

require 'text'

Text::Levenshtein.distance('test', 'test')    # => 0
Text::Levenshtein.distance('test', 'tent')    # => 1

Text::Metaphone.metaphone('BRIAN')            # => 'BRN'
Text::Metaphone.double_metaphone('Coburn')    # => ['KPRN', nil]
Text::Metaphone.double_metaphone('Angier')    # => ['ANJ', 'ANJR']

Text::Soundex.soundex('Knuth')                # => 'K530'

Text::PorterStemming.stem('abatements')       # => 'abat'

Ruby 1.9 Compatibility

The library has been tested on Ruby 1.9.

Work to integrate in Ruby 1.9 compatibility was done by Hampton Catlin (hcatlin)

License

Same as Ruby.