Assignment 3 Part 4 (submitted by Peterson on Feb 10, 18:20)

Beautiful Code
Ka-Ping Yee

AUTHORS:   Adam   Calvin   Chris   David   Derek   Hunter   Jacob   Jason   Jun   Karl   Kevin   Michael   Morgan   Nadia   Nerissa   Omair   Peter   Peterson   Ping   Richard   Scott   Thanh   Varun

Download this file.

COMMENTS

Feb 23, 16:25 - Ping (line 12): Oops, that's a typo.

Please log in if you would like to add comments.

   

  1 def striphelper(inchar):
  2     if inchar.isalpha() or inchar=="'":
  3         return inchar
  4     else:
  5         return " "
  6 
  7 def strippunctuation(instring):
  8     return "".join(map( striphelper, instring ))
  9 
 10 def misspelledWords( instring ):
 11         retlist = []
 12         newstring = strippunctuatoin( instring )
 13         dictfile = open( "dict.txt" )
 14         wordlist = dictfile.read().split()
 15         for w in newstring.split():
 16                 if wordlist.count(w)==0:
 17                         retlist.append(w)
 18         return retlist