next up previous
Next: Storing misspelled words Up: Second assignment Previous: Implementation


Searching the dictionary

As each word is read in, you need to search the dictionary to see if that word is present. How you do this will depend on how you store the dictionary. However, there is an important issue to be dealt with relating to case, in other words whether part or all of the word is capitalised.

Most of the words in both of the dictionaries are in lower case. But initial words of sentences normally have capitals. Your program should therefore allow for initial capitals (whether or not they occur at the beginnings of sentences). Furthermore, the whole text, or some words in it, may be in upper case. Again your program should allow for this. On the other hand, some words are only correctly spelled if they have an initial capital, for example proper names. You will find plenty of these in words.big.txt and a few in words.txt. Your program should attempt to deal with these issues, and your documentation should explain exactly what rules you are applying. Note that you will probably find it helpful here to make use of the methods relating to upper and lower case in the Character and String classes.


next up previous
Next: Storing misspelled words Up: Second assignment Previous: Implementation
Peter Williams 2005-06-07