
Hi Brent, Yes, these are fun. In Python for fun, the user input module has some stuff like this. Mainly spell check in Python. If anyone needs a word list file you can download http://www.ibiblio.org/obp/py4fun/spell.tar.gz It's all of about 180Kb compressed. Here's a little challenge for anyone. Do you know the "Jumble" in some newspapers where you have figure out that "ygenxo" is the word "oxygen"? Actually many people miss that one. Write a bit of Python that solves these like single lookup instantaneously! Chris 07/21/2001 2:12:18 PM, "Brent Burley and Pat Erb" <erburley@ix.netcom.com> wrote:
One of the things I enjoyed while learning to program was playing with a spell check library (anyone remember Borland's Turbo Lightning?) and writing various word filters. This is now trivial in python:
words = open('/usr/share/dict/words').readlines() words = [w[:-1] for w in words] # strip newline chars def aeiou(w): # return true if word uses every vowel ... f = string.find ... for c in 'aeiou': ... if f(w, c) == -1: return 0 ... return 1 filter(aeiou, words) ['adventitious', 'aeronautic', 'ambidextrous', 'argillaceous', 'argumentation', 'auctioneer', 'audiotape', 'augmentation', 'aureomycin', ...]
Other ideas: - find palindromes - find the words with the most number of each letter - find words with no vowels - find the word with the most vowels/consonants in a row - make a histogram of letters used - find words whose reverse is a word - build a crossword puzzle solver
Most systems have a word list, but perhaps not in the location shown above. Try 'man spell' and look in the FILES section.
Brent Burley
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig

On Sat, 21 Jul 2001, Chris Meyers wrote:
Yes, these are fun. In Python for fun, the user input module has some stuff like this. Mainly spell check in Python. If anyone needs a word list file you can download
Is this similar to the "words" text file that Don Knuth prepared for his "Stanford Graphbase" project? http://www-cs-faculty.stanford.edu/~knuth/sgb.html As one example, Knuth compiled a list of common 5-letter words that he used to test combinatorial algorithms. Perhaps this word list could be incorporated into the py4fun project: ftp://labrea.stanford.edu/pub/sgb/words.dat
participants (2)
-
Chris Meyers
-
Danny Yoo