Question: THIS IS IN JAVA CODE. i know the files wont open but just set it up like they do. Automated spell checkers are used to
THIS IS IN JAVA CODE. i know the files wont open but just set it up like they do.
Automated spell checkers are used to analyze documents and locate words that might be misspelled. These programs work by comparing each word in the document to a large dictionary of words. If the word is not found in the dictionary, it is flagged as potentially incorrect.
Write a program to perform spell-checking on a text file. To do this, you will need to get a large file of English words in alphabetical order, read this file (use the given dictionary.txt
) and store the words in an array (NOT an ArrayList). Next, your program should prompt for a file to analyze (use the given oliver.txt
) and then search every word of oliver in the dictionary file using your own recursive binary search algorithm. Do not use the binarySearch method in Arrays class!!! When reading oliver.txt file, you are required to remove any special characters in the file and consider only the alphabetical words.
If a word is not found in the dictionary, print it on the screen as potentially incorrect. In addition, count the number of incorrectly spelled words, total number of recursive steps for all incorrectly spelled words, and output these counters along with the average number of recursive steps per incorrectly spelled words.
NOTE:
You can design a class with a String array of N elements (You can open the dictionary.txt file in Wordpad and find the # of words, so you know the N), a method to read dictionary file, a method to read analyzethis.txt file, a method to perform binary search, and a method to output all the information. Also see Assignment 2 Discussion in Canvas.
Warning: This program may have slow execution time.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
