[Edu-sig] fun w/ word list

Chris Meyers cmeyers@guardnet.com
Sat, 21 Jul 2001 17:59:32 -0800


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
>