Create a treeset to store any miss-spelled words

Assignment Help JAVA Programming
Reference no: EM132101055

Can you please use the template below to create a simple spell checker program. Your program will have the following characteristics:

Your program will be capable of reading multiple files to be spell checked from command line arguments.

When your program starts up, you will read in the dictionary.txt file which contains a list of known words. Only read in this file once. Store these words in a HashSet data structure.

Create a TreeSet to store any miss-spelled words that you find.

For each file in the command line parameter list, print out the name of the file before reading in any words.

For each file parse out each of the words in the file and check to see if the word is in the HashSet you created with the dictionary.txt words or its already in your list of miss-spelled words.

If the word is in the dictionary HashSet or the miss-spelled word TreeSet then proceed to the next word.

If the word is not in the dictionary or the miss-spelled word list, give your user 2 choices: Add the word to the HashSet dictionary, or add the word to the list of miss-spelled words.

At the end of each file processed, dump out the list of miss-spelled words.

When you then start to read in the next file, make sure you clear the list of miss-spelled words. Keep any words added to the dictionary HashSet.

More details:

In parsing the words in these text files, you will need to filter out punctuation characters. I used the StringTokenizer, and I called the following constructor:
StringTokenizer st = new StringTokenizer(line, " \t,.;:-%'\"");

before checking the word against the dictionary, make sure you lower case the word

if the "word" doesn't start out with a letter (i.e. >= 'a' And <= 'z'), then skip it because it is likely a number

If the word couldn't be found in either list and ends with an 's', try removing the 's' to create a singular version of the word and try again to find the word in your dictionary or miss-spelled word list using the singular version of the word.

Only print out lines that contain a word needing a user response. See the Sample output below from the published answer.

Reference no: EM132101055

Questions Cloud

Which type of contract includes not-to-exceed price : Which type of contract includes a Not-to-Exceed Price? It must be definitized within 180 days.
Print the numbers of the coins to be dispensed as change : Prompt for the number of dollars in payment. If the payment is insufficient, print an error message and reprompt for payment.
What kind of performance standards hospitals : What kind of performance standards hospitals and fire stations need to guide its work force?
Supply chain relationships and global sourcing : Supply Chain Relationships and Global Sourcing. Explain the reasons why companies outsource.
Create a treeset to store any miss-spelled words : For each file in the command line parameter list, print out the name of the file before reading in any words.
Create a function that returns a vector of t : Consider an experiment of tossing a biased coin n = 100 times and recording the number of heads. Let the probability of heads be p = 0.7.
Implications of bittorrent for the music industry : What are the implications of BitTorrent for the music industry? For the motion picture industry?
How does logistics add value to supply chains : What does lead-time mean? Do we strive to reduce or increase lead-time? Why? How does logistics add value to supply chains?
Marketing plan for fictional start-up company : During this course, you have compiled a marketing plan for your fictional start-up company

Reviews

Write a Review

JAVA Programming Questions & Answers

  Having problems running - getting errors

Having problems running, getting errors. Please review the program - error: class, interface, or enum expected

  Write the following method that returns a new string

Write the following method that returns a new string in which the uppercase letters are changed to lowercase and lowercase letters are changed to uppercase.

  Implementation of a simple java class

The purpose of this lab is to gain experience in the design and implementation of a simple Java class.  You will create a class definition and write a simple main method that will test the methods of your class to ensure they work as expected.

  Write all data from the parallel arrays

Write all data from the parallel arrays back to the three data files.

  Writing messages to a serversocket in java

the server must accept a connection before the client can communicate.

  Write the classic arcade game of breakout

For each instance variable in your program, explain why you chose to make it an instance variable rather than a local variable - How did you test whether the game would end correctly in this second case? Did you make any changes to the code when test..

  Write a method in java that uses a switch statement

Write a method in JAVA that uses a switch statement and takes a person's age using an integer parameter , then checks if the age is valid (0-110), and then RETURNS a string based on the age

  Write a java program that will read a sequence of names

Write a java program that will read a sequence of names (first name followed by last name, separated by at least one space) from a text file and will 1) remove all duplicate names and 2) write the names (last name followed by a comma, followed by one..

  What is a character class in a pattern

What is a character class in a pattern? What are the predefined character classes, and what do they mean? What are symbolic quantifiers, and what do they mean?

  Create a class named student that has three member variables

Create a class named Student that has three member variables

  A method that takes a two-dimensional array

A method that takes a two-dimensional array of int's as a parameter and searches the array for the second parameter, returning true if the second parameter matches any of the integers in the array, and false otherwise.

  Cross the dark knight and the living flame of love

What challenges does spain get from the text john of the cross the dark knight and the living flame of love?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd