Clabbers - An anagram tool (rev. 39)


Table of Contents

Preamble
Using Clabbers
Downloads

Preamble

I've played Scrabble [1] for years and I never seem to tire of it. The technical part of my brain wondered if there was a way to find out every valid word possible for a given rack of letters, including blanks. Well here we are: Clabbers.

Clabbers is a couple of Perl scripts, a word list and a SQL schema. It was designed for use with PostgreSQL though I see no reason why it can't be ported to other database back ends. Please feel free, encouraged in fact, to do so.

The software can run with almost any word list at all, I've included the SOWPODS word list as a good example. The almost qualification is more a restriction of the database back end, specifically if it can have table names containing non A to Z letters.



[1] Scrabble is the registered trademark of Mattel and/or J. W. Spears, depending on where you live. Wherever I use the word in these pages please mentally insert all the appropriate copyright and trademark paraphenalia.

Using Clabbers

I'm assuming that you already have PostgreSQL installed and configured, you will also need the Perl DBI:Pg library. The schema included will work for any word list that uses the plain A to Z alphabet.

If you use Debian, you can install everything needed with:

aptitudeinstallpostgresqllibdbd-pg-perl

Assuming that we start with an empty database called sowpods which is owned by a user of the same name, we need to load the schema:

psql--usersowpods-fsowpods_schema.sqlsowpods

This will create 27 tables and several indexes. We next need to insert the words into the database.

make-clabbers-index.pl

This will take some time to process, it's about 1.6 million INSERTs in total for the SOWPODS wordlist but once done you should be ready to go. To test try:

clabbers.pland_

If all is well, this will give you all possible words for those three letter plus one blank tile.

martin@winter:~clabbers-0.0.4#./clabbers.pland_

2(42):aaabadaeagahaialamanarasatawaxaybadadedidoeaed
enfahaidinkalamananenonunyodonpataunya

3(74):addadoadsadzaidainanaandaneaniannantanyardawnbadban
cadcandabdaddaedagdahdakdaldamdandapdasdawdaydendindondunean
endfadfangadganhadhanladmadmanmnanabnaenagnahnamnannapnasnat
nawnaynednidnododapadpanradransadsantadtanvanwadwan

4(22):andsbanddamndangdankdansdantdarndawndeandonaduanfandhand
landmandnadanardpandrandsandwand

You can also restrict the word set returned to those containing a particular string. Given the word set used above, we could only return words containing aw like this:

martin@winter:~/clabbers/trunk$./clabbers.pland_aw

2(1):aw

3(3):awndawnaw

4(1):dawn

Downloads

Clabbers is free software released under the GNU Public Licence. I welcome feedback and suggestions for improvements.

The latest version of Clabbers is 0.0.6 and you can download it here.

The work-in-progress version of Clabbers can be downloaded using Subversion.

svncohttp://svn.hinterlands.org/clabbers/trunk/