jcolibri.method.retrieve.NNretrieval.similarity.local.textual
Class CosineCoefficient

java.lang.Object
  extended by jcolibri.method.retrieve.NNretrieval.similarity.local.textual.CosineCoefficient
All Implemented Interfaces:
LocalSimilarityFunction

public class CosineCoefficient
extends java.lang.Object
implements LocalSimilarityFunction

Cossine Coefficient Similarity.

This function computes: |intersection(o1,o2)| / (sqrt(|o1|)*sqrt(|o2|)).

It is applicable to any Text object.

Developed at: Robert Gordon University - Aberdeen & Facultad Informática, Universidad Complutense de Madrid (GAIA)

Version:
2.0
Author:
Juan Antonio Recio García

Constructor Summary
CosineCoefficient()
           
 
Method Summary
 double compute(java.lang.Object caseObject, java.lang.Object queryObject)
          Applies the similarity
 boolean isApplicable(java.lang.Object o1, java.lang.Object o2)
          Indicates if the function is applicable to two objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CosineCoefficient

public CosineCoefficient()
Method Detail

compute

public double compute(java.lang.Object caseObject,
                      java.lang.Object queryObject)
               throws NoApplicableSimilarityFunctionException
Applies the similarity

Specified by:
compute in interface LocalSimilarityFunction
Parameters:
caseObject - IEText
queryObject - IEText
Returns:
the result of the similarity function
Throws:
NoApplicableSimilarityFunctionException

isApplicable

public boolean isApplicable(java.lang.Object o1,
                            java.lang.Object o2)
Description copied from interface: LocalSimilarityFunction
Indicates if the function is applicable to two objects

Specified by:
isApplicable in interface LocalSimilarityFunction

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es