Free word list for use programmatically?

You can find a 2.2mb list of english words here.

You can access them using the file i/o functions.


Most unix (which includes osx) have a file /usr/share/dict/words.


Options:

  1. Look for /usr/share/dict/words on your common or garden variety Unix install.
  2. http://www.ibiblio.org/webster/
  3. http://wordlist.sourceforge.net/
  4. http://svnweb.freebsd.org/csrg/share/dict/ (click the 'revision' tag of the file 'words')

#4 is the one I used for my own Python experiment into word games, and it worked nicely.

For bonus points, here's something to get you started on your word program:

import re
startwith = "MOON"
endwith = "GOLF"
cklength = re.compile('.{' + str(len(startwith)) + '}(\n)?$', re.I)
filename = "C:/dict.txt"
words = set(x.strip().upper() for x in open(filename) if x.match(cklength))

Words will then be a set of all 4 letter words in the dictionary. You can do your logic from there.


if you have access to a linux install, there should be some word lists in

/usr/share/dict/