Text

Actually released a while ago, but hey.

http://rubyforge.org/projects/text/

gem install text

Soundex, Metaphone, Double Metaphone, Levenshtein, and Figlet
algorithms all under the same roof. Any suggestions for anything to add?

On Wed, 11 Oct 2006, Tim F. wrote:

Soundex, Metaphone, Double Metaphone, Levenshtein, and Figlet
algorithms all under the same roof. Any suggestions for anything to add?

Wow! With a list like that, the only thing left is FWIMNWIS. (Find What
I Mean, Not What I Say)

:-))

Downloaded! Thanks!

John C. Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : [email protected]
New Zealand

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim F. wrote:

Actually released a while ago, but hey.

http://rubyforge.org/projects/text/

gem install text

Soundex, Metaphone, Double Metaphone, Levenshtein, and Figlet
algorithms all under the same roof. Any suggestions for anything to add?

Awesome! Thanks for making this much needed library. This gives
everyone the chance to create simple yet effective interfaces based
solely on text-based input (e.g. Google), instead of laboring over
the same old heavy-weight GUI interfaces.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFLP1EmV9O7RYnKMcRAn4zAJ0Xa6cEY0FQLnCWzohOuJ9CJw2jnwCcDml0
mYFhVp1QCJO599joFTBLBhE=
=xM3W
-----END PGP SIGNATURE-----

Tim F. wrote:

Actually released a while ago, but hey.

http://rubyforge.org/projects/text/

gem install text

Soundex, Metaphone, Double Metaphone, Levenshtein, and Figlet
algorithms all under the same roof. Any suggestions for anything to add?

Porter stemming is the only standout that I can think of which might be
useful in addition… Google says there’s one here:

http://www.tartarus.org/martin/PorterStemmer/ruby.txt

It’s public domain code, according to
http://www.tartarus.org/martin/PorterStemmer/.

Version 1.1.0 now includes the Porter Stemmer. Thanks for the
suggestion Alex!

Alex Y. wrote:

Porter stemming is the only standout that I can think of which might be
useful in addition… Google says there’s one here:

http://www.tartarus.org/martin/PorterStemmer/ruby.txt

It’s public domain code, according to
http://www.tartarus.org/martin/PorterStemmer/.

There is also a Ruby interface to WordNet, although I’m not sure how
current it is.

Tim F. wrote:

Version 1.1.0 now includes the Porter Stemmer. Thanks for the
suggestion Alex!

Sorry for the dumb question, but I couldn’t find ANY documentation in
the Text gem directories so I’ll ask here. How do you include and use
this libarary? I think that “require_gem ‘Text’” works but how do I
then use it? When I try:

Text::Levenshtein(str1, str2)

or

Text.Levenshtein(str1, str2)

…I get a “undefined method `Levenshtein’ for Text:Module”

Thanks for the help.

Not a dumb question, seeing as the documentation isn’t actually
included in the gem. I’ll fix that in the next release. For
Levenshtein, the following should work:

require 'rubygems'
require 'text'
Text::Levenshtein.distance(a, b)

You can also view the main README here:
http://rubyforge.org/cgi-bin/viewvc.cgi/README.rdoc?revision=11&root=text

Hope that helps!

On 25/10/06, Tim F. [email protected] wrote:

You can also view the main README here:
http://rubyforge.org/cgi-bin/viewvc.cgi/README.rdoc?revision=11&root=text

I uploaded the currents docs to the project web space a few days ago.

http://text.rubyforge.org/

It makes for easier browsing there, I think.

Paul.

Paul B. wrote:

On 25/10/06, Tim F. [email protected] wrote:

You can also view the main README here:
http://rubyforge.org/cgi-bin/viewvc.cgi/README.rdoc?revision=11&root=text

I uploaded the currents docs to the project web space a few days ago.

http://text.rubyforge.org/

It makes for easier browsing there, I think.

Also, a mixin for String that provided method interfaces to all these
would be cool. Eg.

module TextMix
def double_metaphone
Text::Metaphone.double_metaphone(self)
end

end

class String
include TextMix
end

And while not exactly in the same category, it might be close enough –
maybe add Dresner which is simply:

str.gsub(/\B\w+\B/){$&.split(//).sort_by{rand}}

T.

On 10/25/06, Trans [email protected] wrote:

Paul B. wrote:

On 25/10/06, Tim F. [email protected] wrote:

You can also view the main README here:
http://rubyforge.org/cgi-bin/viewvc.cgi/README.rdoc?revision=11&root=text

I uploaded the currents docs to the project web space a few days ago.

Very cool. Thanks. I had a couple of these in separate libraries.
This is nice.

Michael

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs