Assigned Date: Wednesday, Nov. 16, 2005 (sec 2 +1 day)
Due Date: Thursday, Dec. 1, 2005 (sec 2 +1 day)
Due Time: Noon
Last modified on November 17, 2005, at 03:32 PM (see updates)
This assignment focuses on linked lists.
TextAnalyzer ADT in Java. This ADT encapsulates a list of items stored using a sorted doubly-linked list with dummy head and tail nodes. The list contains unique words sorted lexicographically (case insensitive) and corresponding counts. Adding a duplicate word simply increments the corresponding count. Deleting a word, decrements the corresponding count. Deleting the last instance of a word, completely removes that word (and corresponding count) from the list.
In terms of implementation,
TextAnalyzer objects should have three
Node references, head, tail, and currentPosition. There should NOT be a
numItems (or similar) variable, i.e., the length of the list will be calculated dynamically whenever it is needed.
Node should be implemented as an internal class. It should encapsulate a
word and a
count, as well as a
TextAnalyzer has the following API:
Nodeobjects linked appropriately.
public void add(String word)
public void remove(String word)
public int getFrequency(String word)
public double getProbability(String word)
public void reset()
public String getNextWord()
public int getUniqueWordCount()
public int getAllWordCount()
Here is something extra for bonus points.
Your code should be fully documented via javadoc. Your code should throw approppriate runtime exceptions to test preconditions and handle errors.
Include the following in each class:
Certification of Authenticity: I certify that this submission is entirely my own work, as per course collaboration policy. Name: ________________________ Date: ___________
.jarfile to firstname.lastname@example.org, by the due date and time.