comirva.web.text.similarity
Class SimMeasure_CosineSim

java.lang.Object
  extended by comirva.web.text.similarity.SimMeasure
      extended by comirva.web.text.similarity.SimMeasure_CosineSim

public class SimMeasure_CosineSim
extends SimMeasure

Cosine distance.


Nested Class Summary
 
Nested classes/interfaces inherited from class comirva.web.text.similarity.SimMeasure
SimMeasure.SimType
 
Constructor Summary
SimMeasure_CosineSim(NormFunc normFunc)
           
 
Method Summary
protected  float getSimilarity_intern(float[] item1, float[] item2)
          Calculates and returns the [0,1]-normalized cosine similarity.
 
Methods inherited from class comirva.web.text.similarity.SimMeasure
getName, getSimilarity, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimMeasure_CosineSim

public SimMeasure_CosineSim(NormFunc normFunc)
Method Detail

getSimilarity_intern

protected float getSimilarity_intern(float[] item1,
                                     float[] item2)
                              throws SizeMismatchException
Calculates and returns the [0,1]-normalized cosine similarity. between two float[] data vectors item1 and item2.

Specified by:
getSimilarity_intern in class SimMeasure
Parameters:
item1 - vector representing the first artist
item2 - vector representing the second artist
Returns:
a float value which is the cosine similarity between data vector item1 and item2
Throws:
SizeMismatchException