COMP – 10205 – Data Structures and Algorithms

Description

You are to write a program that will countthe words and occurrences of words in thebookWar

Don't use plagiarized sources. Get Your Custom Assignment on
COMP – 10205 – Data Structures and Algorithms
From as Little as $13/Page

and Peace by Leo Tolstoy. In addition to counting words, you must spell check the document
and report how many words are not found in the provided dictionary. You will also match
occurrences of the word War with Peace and find the average distance between the closest set
of each pair of these words.
You must use a class called BookWord (provided as UML below) to store each word for the
words in the novel and for the words in the provided dictionary. The words must be stored
without concern for case sensitivity (all characters must be converted to lowercase).
A word is considered to be one or more characters in length separated by white space (space
character, tab, new line character), a comma, period, exclamation point, question mark, double
quote mark, either round bracket, underscore, hyphen, colon or semicolon. The regex
expression below can be used to implement this functionality with the .useDelimiter method of
the scanner object. Other punctuation marks such as single quote, apostrophe, forward slash
and backslash should not be included in words, however, for the purpose of this assignment it
is sufficient to only exclude words containing the single quote character. For example, the
word it’s should not be considered a word, and should be discarded from the input.
String regEx = “\.|\?|\!|\s|”|\(|\)|\


|\_|\-|\:|\;|\n””;