# Richard Shiao # CS198-Python # 2003-02-09 # Craft 3, Part 4 import re true = 1 dictfile = open(file) dict = {} for line in dictfile: pat = re.compile('(\n)') entry = pat.sub('',line) dict[entry] = true def checkword(word): """Returns true (1) if the single word is spelled correctly.""" return dict.get(word)