About

I am a software developer in Seattle, building a new AI software company.

Ads

April 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Ads


« Smart Posts | Main | NStatic Status »

January 13, 2006

Word Finder

In my post on Human versus Computer, I mentioned a Scrabble Word Finder program I had written several years ago. Here it is — Word Finder Zip File. This program allows one to perform pattern and anagram searches to locate every legitimate Scrabble word that matches.

WordFinder2

What I like about this program is how it demonstrates the benefits of using the computer to perform brute search on all the possible permutations of a word. I asked the reader how many different legitimate 3–letters words can that he can make from the word TEA. More than likely, the reader will fail to account for every possible word. Run this program, choose anagram search and find out. It becomes exponentially more difficult to find all combinations of larger words.

PS: I no longer have the source code, so I can’t really remove the Scrabble trademark except through a hex editor.

This program is free… since I doubt that  I could make any money off of it.

Comments

I'd like to have a look at your code, but the ftp site is password protected...

Regards


Mark

"What I like about this program is how it demonstrates the benefits of using the computer to perform brute search on all the possible permutations of a word."

There is a much more intelligent algorithm, of course. Given a dictionary of words (the words file from a Linux distribution will do), you perform a little preprocessing: you sort all the letters of every word in alphabetical order, then add the alphabetized letters to a hash table, where the value of the hash table is a list of words that are made up of those letters. For example:

aet: [ate, eat, tea, ...]

Once you've created this hash table (a linear operation, you simply add to the list if the alphabetized letters are already in the table), finding all the anagrams for a word is a constant time operation: simply alphabetize and look up.

Oops! I changed the link to refer to http instead of ftp. This should now work.

The algorithm that I used does not require a full search for either wildcard patterns or anagrams.

It is extremely fast, because it takes advantage of trie data structure, and treats it as a state machine, so the time of the operation is proportional to the the count of the final results. If I was developing the software today, I might have used a ternary tree.

The program that I have here must be an old version because it is 1.5Mb, whereas a newer version managed to squeeze 160,000 words into a few hundred kilobytes.

Is there a scrabble word finder for PALM pda's?

Thank you for this nice program. Can I trouble you for which dictionary list you use? Is it adjustable?
James

I don't have anything for the Palm... I used a public domain list, that you can probably find on the web.

There is an online resource too for help with words for playing scrabble.

Just check out the site below..I think people are going to simply love it.

www.wineverygame.com

The comments to this entry are closed.