As part of my Daring Furball project, I needed a LOLspeak translation dictionary. I’ve finally pushed out a 1.0 release and setup a project page. The dictionary itself is just a big YAML file. However, there’s Ruby code to translate whole strings as well as the text portions of an XML document. The Ruby code (which comes with the dictionary) is available as a gem under the
lolspeak project. To install it, simply use the
% sudo gem install lolspeak
It’s pure Ruby code, so this should run on any Ruby-supported platform (though I’ve only tested on OS X and Linux). The main API you’ll use is the extension to the String class:
"Hi cat".to_lolspeak -> "oh hai kitteh"
There’s a bit more to it, but that’s the gist of it. It also installs a command line program called
lolspeak which allows you to perform translations on the command line:
% lolspeak hi cat oh hai kitteh
If you are on Mac OS X, you can use ThisService to turn the command line application into a handy dandy system service. Then you can perform translashuns in any applicashun!
Mac OS X users get one extra bonus, too. I’ve created a custom LOLspeak dictionary that plugs into the standard Dictionary application. While not a widely known feature, it’s quite easy to create custom dictionaries. Thus, it was a simple task to convert the YAML file into the dictionary XML. Here’s a screenshot:
See the project page for downloading and installation instructions. I’ll probably update the dictionary periodically. If you want to help out, send me patches against the
tranzlator.yml file. Bonus points if create the patch using Mercurial export. Be sure to re-sort the dictionary prior to creating a patch:
% ./sort_tranzlator.rb tranzlator.yml