Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 988 Bytes

README.rdoc

File metadata and controls

36 lines (23 loc) · 988 Bytes

Text

A collection of text algorithms.

Usage

require 'text'

font = Text::Figlet::Font.new('big.flf')
figlet = Text::Figlet::Typesetter.new(font)
figlet['Hello World']                         # => '...'

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

Most parts of the library are now compatible including tests. The big exception are the Figlet libraries which allow you to quickly do text-rendering in ASCII. On 1.9, Figlet isn’t loaded and isn’t tested.

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

License

Same as Ruby.