Sha256: a63e1e1e731c6515d60bb9031c0c670f231031de143cb5c2ee2ce02246bbd15a

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

= Text

A collection of text algorithms.

== Usage

  require 'text'

=== Levenshtein distance

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

=== Metaphone

  Text::Metaphone.metaphone('BRIAN')
  # => 'BRN'

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

=== Soundex

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

=== 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

* Hampton Catlin (hcatlin) for Ruby 1.9 compatibility work
* Wilker LĂșcio for the initial implementation of the White algorithm

== License

Same as Ruby.

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
text-1.0.5 README.rdoc
text-1.2.1 README.rdoc
text-1.2.0 README.rdoc
text-1.0.4 README.rdoc
text-1.0.3 README.rdoc
text-1.0.2 README.rdoc
text-1.0.1 README.rdoc
text-1.0.0 README.rdoc