Spell Checker
This program is a light weight version spell checker.
I will provide the driver code for your spell checker,
and you will have to put the pieces together.
We will need to define types for Word, List, and Dict.
The driver is available on vulcan at
/home/jclark/class_code/spring08/2840/spell_checker
It will be based on the code used in my 1620 class.
Here is the 1620 driver main.cpp
Here is the source we did in class source.sh
It is due on March 26th.
Make sure you submit all of the source to include your driver.
Here is a simple example run.
Note : the spell checker is only as good as the dictionary, the one I
installed has only 45427 words. It does not have 1 letter
words, or contractions.
Goals
- review operator overload
- use object composition/inheritance
- integrate object-oriented code
- do specification programming
The Soundex Algorithm
- the first letter of the code is the first letter of the input word.
- the remaining letters of the code are any code that is non-zero,
and different from the code of the previous letter ( begining with the
second letter of the word ).
Soundex codes for this assingment are 1 letter and 4 digits.
But you will want to store the digits as characters so the entire
code is the same type.
The code contains the first letter of the word (case doesn't matter).
and the the others are mapped to numbers.
The mappings are provided below, in the table.
Any time a code is the same as the code of the previous character,
it is discarded.
If I am using 4 digits the default is "Z0000".
| Letters | Numbers |
| b,p,f,v | 1 |
| c,s,k,g,j,q,x,z | 2 |
| d,t | 3 |
| l | 4 |
| m,n | 5 |
| r | 6 |
| All Others | 0 |
Examples
A friend of mine has the last name is Sullivan, so the 4 digit soundex is:
Sullivan
20440105
S4150
Your soundex codes for this need to be 1 letter and 4 numbers.
It will be easier if you store everything in a character array that
is NULL terminated.
Examples:
tomorrow T5600
tenure T5600
Lukasiewicz L2220
spellllllll s1400
lalalalalalalalalalalalalalala L4444
damn D5000
spell S1400
Euler E4600
Gauss G2000
Hilbert H4163
Knuth K5300
Lloyd L3000
1234 Z0000