jcolibri.test.test13.similarity
Class TokensContained

java.lang.Object
  extended by jcolibri.test.test13.similarity.TokensContained
All Implemented Interfaces:
LocalSimilarityFunction

public class TokensContained
extends java.lang.Object
implements LocalSimilarityFunction

This function returns a similarity value depending on the tokens (words) that appear in the query attribute and also are in the case attribute.


Constructor Summary
TokensContained()
          Creates a new instance of TokensContained
 
Method Summary
 double compute(java.lang.Object caseObject, java.lang.Object queryObject)
          Computes the similarity between two objects
 boolean isApplicable(java.lang.Object o1, java.lang.Object o2)
          Applicable to String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokensContained

public TokensContained()
Creates a new instance of TokensContained

Method Detail

compute

public double compute(java.lang.Object caseObject,
                      java.lang.Object queryObject)
               throws NoApplicableSimilarityFunctionException
Description copied from interface: LocalSimilarityFunction
Computes the similarity between two objects

Specified by:
compute in interface LocalSimilarityFunction
Parameters:
caseObject - object of the case
queryObject - object of the query
Returns:
a value between [0..1]
Throws:
NoApplicableSimilarityFunctionException

isApplicable

public boolean isApplicable(java.lang.Object o1,
                            java.lang.Object o2)
Applicable to String

Specified by:
isApplicable in interface LocalSimilarityFunction

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