A C D F G I M P S T W

A

addAndIncrement(String) - Method in class SortedWordList
This method takes as input a word and uses the cleanWord method to remove special characters.
addOnly(String) - Method in class SortedWordList
This method takes as input a word, uses the cleanWord method to remove special characters, and inserts a new WordCount object with count of 0 only if the word does not yet appear in the list.

C

cleanWord(String) - Method in class SortedWordList
A helper method that takes as input a word and removes all characters that are not numbers or digits.
count - Variable in class WordCount
 

D

display() - Method in class SortedWordList
Display all elements in the list.
DocumentProcessor - Class in <Unnamed>
The DocumentProcessor class processes two documents and calculates their similarity score.
DocumentProcessor(String, String) - Constructor for class DocumentProcessor
Constructor takes as input two file names and saves the values into the data members of the class.

F

f1name - Variable in class DocumentProcessor
 
f2name - Variable in class DocumentProcessor
 

G

get(int) - Method in class SortedWordList
Return the ith WordCount object in the list.
getCount() - Method in class WordCount
Return the count.
getWord() - Method in class WordCount
Return the word.

I

increment() - Method in class WordCount
The increment method adds one to the count.

M

main(String[]) - Static method in class SimilarityDriver
The main method must be passed as input two strings representing the names of two files to be compared.

P

processDocuments() - Method in class DocumentProcessor
The processDocuments method reads in both file 1 and file 2 and builds a SortedWordList object for each.

S

SimilarityCalculator - Class in <Unnamed>
The SimilarityCalculator class calculates the similarity between two documents.
SimilarityCalculator() - Constructor for class SimilarityCalculator
 
SimilarityDriver - Class in <Unnamed>
The class containing the main method.
SimilarityDriver() - Constructor for class SimilarityDriver
 
similarityScore(SortedWordList, SortedWordList) - Static method in class SimilarityCalculator
Given two SortedWordList objects, this method will calculate the cosine similarity score of the documents represented by the word lists.
size() - Method in class SortedWordList
Return the size of the list.
SortedWordList - Class in <Unnamed>
This class maintains a sorted list of WordCount objects.
SortedWordList() - Constructor for class SortedWordList
Constructor initializes the ArrayList data member.

T

theWord - Variable in class WordCount
 
toString() - Method in class WordCount
Returns a string representation of the object in the form: Word: theWord Count: count

W

WordCount - Class in <Unnamed>
This class stores a word and a count representing the number of times the word appears in a document.
WordCount(String) - Constructor for class WordCount
Constructor takes as input the word and initializes the count to 0.
words - Variable in class SortedWordList
 

A C D F G I M P S T W