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

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

public class DiceCoefficient
extends java.lang.Object
implements LocalSimilarityFunction

Dice Coefficient Similarity.

This function computes: 2*|intersection(o1,o2)| / |o1|+|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
DiceCoefficient()
           
 
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

DiceCoefficient

public DiceCoefficient()
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