Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Collection of text algorithms. gem install text
Ruby
tag: v0.1.14

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
README.rdoc
Rakefile

README.rdoc

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.

Something went wrong with that request. Please try again.