Letter Pattern Word Search

May 30, 2012

This is a JavaScript/PHP implementation of the letter pattern word search program. This takes a series of C and V characters then finds words with matching consonants and vowels with the given pattern.

I originally built a C++ version of this to find words with given patterns for a puzzle I was making. The puzzle might get used someday so I won’t post it just yet. This PHP version is a bit slower than the C++ version but it is surprisingly fast even when searching for a common pattern like “CVCC”.

The client side is HTML within an iframe to allow it to make an AJAX request of a server different from this blog server. The server code is written in PHP and returns a list of words as HTML data with line breaks between each word. There is a directory on the server with a bunch of text files holding the words. These were obtained from various free sources on the internet. The PHP script filters out duplicates, of which there are many.

Vowels are A-E-I-O-U in this program since puzzles need to have only one non-ambiguous solution.