In this assignment, you will write two classes to provide objects that support the SpellChecker program. This program suggests spelling corrections to English words entered from the keyboard. Words entered by the user of the program will be compared to a list of over 105,000 words supplied in a data file (wordsEn.txt ). If an entered word is not found in the word list, you provide as alternative spellings, at most five words from the word list that have:
1 The same length as the entered word, and
2 The smallest Hamming distance from the entered word
The Hamming distance between two strings of equal length is the number of positions in the strings at which the corresponding characters are different. For example, the strings “ample” and “apple” have a Hamming distance of 1, since they only differ in the 2nd character. The words “apfel” and “apple” have a Hamming distance of 3, since they differ in the 3rd, 4th and 5th characters.
You may assume the following:
1 When there are multiple words with the same minimum Hamming distance from the entered word, you should report only the first 5 (alphabetically speaking). You must report all words that are at the same distance, up to 5; words with a longer distance will not be reported.
2 The words in the data file are in alphabetic order.
3 All words are lower case.
What your classes must do
You are to write two classes, HammingList and HammingCandidate.