def striphelper(inchar): if inchar.isalpha() or inchar=="'": return inchar else: return " " def strippunctuation(instring): return "".join(map( striphelper, instring )) def misspelledWords( instring ): retlist = [] newstring = strippunctuatoin( instring ) dictfile = open( "dict.txt" ) wordlist = dictfile.read().split() for w in newstring.split(): if wordlist.count(w)==0: retlist.append(w) return retlist