CS21 Homework 6
Due Monday, November 6 by midnight


Before you begin, type update21 to copy the homework files into your directory. Then move to the current homework directory by typing: cd cs21/homework/6. Your solution should be entered into the file spellChecker.py.

You should work alone on this homework.


Introduction

For this assignment you will implement an automated spell checker. It will read in a text document and locate words that might be misspelled. Your program will work by comparing each word in the document to a large dictionary of words. Any word that is not found in the dictionary, will be reported.


Sample Run of the Spell Checker

Suppose you wanted to spell check the following file named text1 (which is available in cs21/homework/6):

Hllo,

I'm home for the holidys and was hopting we could get togethersoon.
Let me knw if that wil work for you.

Susan

Your program should produce the following interaction with the user:

Welcome to the automated spell checker!
Using an American English dictionary with 96274 words.

Enter name of text file to spell check >> text1

The following words were NOT found in the dictionary:

Hllo
holidys
hopting
togethersoon
knw
wil

Requirements


Extra Credit: Suggesting Corrections

This portion is not required, and should only be attempted once you complete what is described above.

Most modern spell checkers offer a very useful feature. As they spell check a document they make suggestions about possible replacement words for misspelled words. As an example of this, try xemacs text1 and click on the "Spell" button at the top center of the screen. Notice that your screen splits into two, and at the top are a number of suggestions for the highlighted word. You can press the space bar to leave a word alone or choose a letter for a particular replacement. You can press CTRL-g to quit the spell checking at any time.

Try to implement a few basic strategies for making reasonable suggestions for corrections. You can simply print your suggestions with the report of each misspelled word.


Use handin21 to turn in your program.