Question

Méalgomé, a techie blogger, has a good command of the english language and his typing skills are quite good. As a conservative computer geek, he is stuck with a text editor that does not perform spell-check. He believes that even the spell checker of modern editors would not be able to let go of the technical words that do not appear in regular dictionaries. Moreover, his Page 2 of 5 one-off mistakes on his blogs are becoming a divergence when comments received are with respect to the spelling mistakes rather than on the ideas he is putting forward. He decided to work on developing a simple plugin, to his favourite text editor, which would be a dynamic spell checker. His main requirement is that the more documents he types, the better should be the spell checker in recognizing the regular english words and his technical words. Moreover, he believes that if words are repeated, the document becomes boring for reading. As such, he wants to check the level of word repetitions in the document. He computes the latter by taking the number of distinct words in the document and dividing it by the total number of words. For the design and implementation, he is thinking that hashing might be a good technique to solve this problem. For the spell check, each word typed in a document becomes the key for the hash table. The corresponding value is the number of times that the particular word has been encountered so far. There are two plugins expected to be written, one is to mainly count the number of distinct words in a file and the other one is to perform a spell-check on the file. Apart from proper coding, you will be marked for proper analysis of the situations, proper understanding and applications of the studied data structures and algorithms, and clarity and precision in explanations provided.


You are required to write the code for the following programs: (i) DistinctWords.java, where hashing is used to count the number of distinct words and level of repetition in a file. (ii) Spellchecker.java, where hashing is applied for spell checking. [12 marks] You may assume the following when writing the above plugins: ● A mistake is unique. It appears at most once. While any other word, that is correctly written, appears more than once. ● For simplicity, there is a space before and after any punctuation mark. Such that words are not mixed up with punctuation marks when splitting using a space. ● The only punctuation marks used here are the ‘,’ and the ‘.’.

PLEASE COMPLETE THE MISSING CODES FOR BOTH (DistinctWords.java AND SpellChecker.java)

2 4 DistinctWords.java Spellchecker.java 1 Import java.util.; 3 // DistinctWords.java, where hashing is used to count the nu

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Méalgomé, a techie blogger, has a good command of the english language and his typing skills...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Using the diagram below and the starter code, write Document Processor that will read a file...

    Using the diagram below and the starter code, write Document Processor that will read a file and let the user determine how many words of a certain length there are and get a count of all of the word lengths in the file. Your program should do the following: The constructor should accept the filename to read (word.txt) and then fill the words ArrayList up with the words from the file. The countWords method should accept an integer that represents...

  • create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines....

    create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines. ** Each method below, including main, should handle (catch) any Exceptions that are thrown. ** ** If an Exception is thrown and caught, print the Exception's message to the command line. ** Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the...

  • In this lab you will write a spell check program. The program has two input files:...

    In this lab you will write a spell check program. The program has two input files: one is the dictionary (a list of valid words) and the other is the document to be spellchecked. The program will read in the words for the dictionary, then will read the document and check whether each word is found in the dictionary. If not, the user will be prompted to leave the word as is or type in a replacement word and add...

  • Assignment 3: Word Frequencies Prepare a text file that contains text to analyze. It could be...

    Assignment 3: Word Frequencies Prepare a text file that contains text to analyze. It could be song lyrics to your favorite song. With your code, you’ll read from the text file and capture the data into a data structure. Using a data structure, write the code to count the appearance of each unique word in the lyrics. Print out a word frequency list. Example of the word frequency list: 100: frog 94: dog 43: cog 20: bog Advice: You can...

  • Write a C program to run on ocelot to read a text file and print it...

    Write a C program to run on ocelot to read a text file and print it to the display. It should optionally find the count of the number of words in the file, and/or find the number of occurrences of a substring, and/or take all the words in the string and sort them lexicographically (ASCII order). You must use getopt to parse the command line. There is no user input while this program is running. Usage: mywords [-cs] [-f substring]...

  • Finish the given ProcessFile.java program that prompts the user for a filename and reprompts if file...

    Finish the given ProcessFile.java program that prompts the user for a filename and reprompts if file doesn’t exist. You will process through the file skipping any text or real (double) numbers. You will print the max, min, sum, count, and average of the integers in the file. You will want to create test files that contain integers, doubles, and Strings. HINT: Use hasNextInt() method and while loop. You may also want to use Integer.MAX_VALUE and Integer.MIN_VALUE for the initialization of...

  • C++, program that use the built in string class, its constructors, some of its methods and...

    C++, program that use the built in string class, its constructors, some of its methods and operators. It reads an input file of English text, one word at a time. The file should consist of about 500 words. Keep only the words, removing any punctuation or other characters. .Store the words in a built-in STL container, such as vector or map.,Choose a list of about 10 words, for example, {she,, and, he, or, the}., Remove these words from the list.,,...

  • In this assignment, you will explore more on text analysis and an elementary version of sentiment...

    In this assignment, you will explore more on text analysis and an elementary version of sentiment analysis. Sentiment analysis is the process of using a computer program to identify and categorise opinions in a piece of text in order to determine the writer’s attitude towards a particular topic (e.g., news, product, service etc.). The sentiment can be expressed as positive, negative or neutral. Create a Python file called a5.py that will perform text analysis on some text files. You can...

  • CSC110 Lab 6 (ALL CODING IN JAVA) Problem: A text file contains a paragraph. You are to read the contents of the file, store the UNIQUEwords and count the occurrences of each unique word. When the fil...

    CSC110 Lab 6 (ALL CODING IN JAVA) Problem: A text file contains a paragraph. You are to read the contents of the file, store the UNIQUEwords and count the occurrences of each unique word. When the file is completely read, write the words and the number of occurrences to a text file. The output should be the words in ALPHABETICAL order along with the number of times they occur and the number of syllables. Then write the following statistics to...

  • This last lab teaches you to think and solve problems in the functional programming framework of...

    This last lab teaches you to think and solve problems in the functional programming framework of the Java 8 computation streams. Therefore in this lab, you are absolutely forbidden to use any conditional statements (either if or switch), loops (either for, while or do-while) or even recursion. All computation must be implemented using only computation streams and their operations! In this lab, we also check out the Java NIO framework for better file operations than those offered in the old...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT