Class SimilarityCalculator

java.lang.Object
  extended by SimilarityCalculator

public class SimilarityCalculator
extends java.lang.Object

The SimilarityCalculator class calculates the similarity between two documents.


Constructor Summary
SimilarityCalculator()
           
 
Method Summary
static double similarityScore(SortedWordList l1, SortedWordList l2)
          Given two SortedWordList objects, this method will calculate the cosine similarity score of the documents represented by the word lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimilarityCalculator

public SimilarityCalculator()
Method Detail

similarityScore

public static double similarityScore(SortedWordList l1,
                                     SortedWordList l2)
Given two SortedWordList objects, this method will calculate the cosine similarity score of the documents represented by the word lists. The method returns a double between 0 and 1. If the word lists are of different lengths, the method will print an error message and return -1.

Parameters:
l1 -
l2 -
Returns: