« Colorful, Suicide Club, The Hidden and Tapeheads | Main | Peas, Cyrus and Ruby »

November 30, 2004

Project SOULTRAIN: Not Forgotten

I am continually amazed by how excellent Ruby is for… well, most everything. While I have every intention of implementing Project SOULTRAIN in Lisp/Prolog, I seem to be generating a bunch of components in Ruby which I would use to implement it. So maybe I’ll go back on my word; this is about something fun for me, after all, whether it’s good for me (think spinach) or not. We’ll see.

Anyway, in the next few days I’ll be fixing up and posting a couple of Ruby gems: String#titlecase and String#metaphone.

String#titlecase lets you do this kind of thing:

"MOBY dick, OR the WHALE".titlecase   # -> "Moby Dick, or the Whale"

String#metaphone lets you do this kind of thing:

"maurice".metaphone  # -> "MRS"
"katherine".metaphone  # -> "K0RN"
"katherine".metaphone(true)  # -> ["K0RN", "KTRN"]
"bob".metaphone(true)  # -> ["PP"]

Anyway, they’re both implemented and both working perfectly, because I stole the C code for String#metaphone from Perl’s Text::DoubleMetaphone, and because nobody really knows what String#titlecase should do, algorithmically speaking. :) So now it’s just a matter of writing documentation, Ruby Gem descriptions, releasing to RubyForge or whatever. I’ve got Trac ‘n Subversion set up with it already so if you know my URLs you can already get at them.

I’m also thinking about making some sort of software page for my blog, other than what I already have, but I’m not quite sure what I’m going to wind up doing.

As an aside, Ruby apparently has about sixteen different web frameworks. There’s Rails, which I think Basecamp might be written in, due to the suspicious 37signals backup of their wiki on the Rails page. There’s also the WEBrick and the standard mod_ruby. I wish these all had better documentation. For the moment I stick to mod_ruby, but I ran into a strange problem the other day.

Apparently from mod_ruby, you can use eRuby and it assumes that HTML comes out. If you use the CGI module, and don’t call cgi.type(“text/html”) then it assumes plain text is coming out. This is especially weird because it goes against the docs. (What I was working on, and am still working on, is a test page for String#titlecase so people can try it out, and email me if it looks “wrong”)

Posted by FusionGyro at November 30, 2004 12:05 AM

Trackback Pings

TrackBack URL for this entry:
http://www.clanspum.net/~fusion/blog/admin/mt-tb.cgi/62

Comments

Hi Dan, any word on when double metaphone will be released? Would love to get access to it.

Posted by: San at May 16, 2005 11:52 PM

Post a comment




Remember Me?

(you may use HTML tags for style)

Want HTML? Use Textile instead.