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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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