We will create a spell checker program. This program will use this file as a dictionary to look up properly spelled words. When the program starts, you will open the dictionary file (name it "Dictionary.txt"). You will utilize a hash function you have created to hash the words into an externally-chained hash table you have created. The hash table will be of a size that you will determine. You must submit a document that describes how you determined the tablesize/load factor. You will also report the following statistics:

  • maximum chain length
  • average chain length
  • percentage of buckets to which one or more words hashed

You will then open an input file named "testTextFile.txt." When the checking proceeds, you will extract a word from the file to be checked, hash it into the table, and determine if it exists. You will continue this process until you have checked all the words in the file. Each time you find a word that you cannot match in the dictionary, you will let the user know and you will attempt to generate a list of suggested words. You will generate the list by assembling similar words via four methods:

1. One letter missing. You assume that one letter has been left out of the word. You can assemble new words to check by adding letters a..z in each of the positions in the word from the start to the end of the word.

Word: te
Search

Ate
Bte
….
Zte

Tae
Tbe
….
Tze

Tea
Teb
….
tez

2. One letter added. You assume the word has an extra letter. You scan through the word deleting each of the letters in turn, and looking up the word formed by the remaining letters.

No duplicate finds-
Example: word thhe
hhe
the
the- duplicate find
thh

3. Two letters reversed. You swap letters in positions 0..1, 1..2, 2..3, ... , n-2..n-1, to form new words which you look up.

Teh-eth-the

4. One letter changed. You try each letter at each position in the word to see if one letter was simply mis-typed.

Each time you find a legal word from any of the four methods, you add it to the suggestion ArrayList, which you present to the user when you have finished this part of the process. If you cannot identify any suggestions, let the user know.

Example file:

Hello. My plan is to hav a test fiile that has UPPer and LOWER case words. All fuor cises of misspellings will be represented. The file will encompass more than one line and will have no other puncktuation than commas, and the dot at the end of a line.

***Side notes****

Use own hash table no api(as much created programming as possible). Similar to project 2.

Can use stringbuffer

Can use toLowerCase()

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.