Ask Java Expert


Home >> Java

Create a spell checker that uses dictionary that stores its words in a balanced binary tree.

Tasks and Requirements

NOTE: Naming is critical in the tasks and requirements described below. If the names don't match those described below exactly, your project will not be graded.

Create a copy of the Java SE Project Template. The project name must follow this pattern: {FLname}_SpellChecker_{TERM}, where {FLname} is replaced by the first letter of your first name plus your last name, and {TERM} is the current semester and year. E.g. if your name is Maria Marciano and it's Fall 2014, your project name must be MMarciano_SpellChecker_F14.

Create a package named spellchecker in your project.

BinaryTreeNode class:

Download BinaryTreeNode.java, and put it in the spellchecker package.

Your BinaryTree class must use BinaryTreeNode to store its words.

Do not modify BinaryTreeNode.java.

BasicDictionary class:

Download the Dictionary.java interface and put it in the spellchecker package.

Read the comments above each method to understand what they are supposed to do.

Create a new class named BasicDictionary in the spellchecker package. In the class creation wizard, click the Add (interface) button, and search for Dictionary. Check the "Inherited abstract methods" box. Click Finish. Eclipse will create the class and automatically add method stubs that meet the Dictionary interface.

You do not modify the Dictionary interface. You add your code to the BasicDictionary class.

BasicDictionary must use a binary tree to store the words in the dictionary. BasicDictionary can hold the root of the binary tree, but a stronger design would use a separate BinaryTree class.

You must write your own binary tree code.

BasicSpellChecker class:

Download the SpellChecker.java interface and put it in the spellchecker package.

Read the comments above each method to understand what they are supposed to do.

In BasicSpellChecker, modify the public class BasicSpellChecker to include implements SpellChecker.

You can use Eclipse's QuickFix support to add the required methods to BasicSpellChecker.

You do not modify the SpellChecker interface. You add your spell-checking code to BasicSpellChecker's methods.

Add the unit testing classes. These classes will be used to test the code that you write.

Create a new package in the src folder called sbccunittest. To be clear: sbccunittest should be a child of the src folder, not of the spellchecker package.

Download SpellCheckerTester.java into sbccunittest.

Download test_files.zip into your project root and unzip them into your project's root folder.

Spell-checking notes

Be sure to read the SpellChecker.spellCheck() documentation carefully. It specifies the regular expression that you must use for iterating through words in the document.

It also describes an instance variable of BasicSpellChecker that you need to create and update - the current spell checking index.

Also be sure to read the SpellChecker.replaceText() documentation carefully. It describes how the spell checking index is to be adjusted when replaceText() is called.

Note that the test documents are Windows files, which means that each line ends with \r\n (i.e. two characters).

Ignore case when comparing words.

Unit Testing

Debug all java compilation Errors (see the Problems view). The unit tests can't be run until these errors are fixed.

In the Package Explorer, right-click on the sbccunittest package | Run As... | JUnit Test.

Initially, all of the tests will probably fail. However, as you add functionality to the BasicDictionary class, tests will begin to pass.

Work on BasicDictionary first. Continue adding functionality to the BasicDictionary until all of the dictionary tests (see Scoring section below) pass. Then start working on BasicSpellChecker and its associated tests.

There is no user interface requirement for this assignment. However, you might find it interesting to build a simple console interface that allows the user to specify a dictionary and a text document to spell check. When an unknown word is found, give the user options to ignore the word, change it themselves, replace it with the preceeding/succeeding word, or end the spell checking. When spell checking is completed, overwrite the original text document with the spell-checked version.

*** When importing the dictionary, build a complete tree

Java, Programming

  • Category:- Java
  • Reference No.:- M93083578

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As