gov.sandia.cognition.text.relation
Interface SimilarityFunction<FromType,ToType>

Type Parameters:
FromType - The type that the similarity is from.
ToType - The type that the similarity is to.
All Known Implementing Classes:
CosineSimilarityFunction

public interface SimilarityFunction<FromType,ToType>

Defines the functionality of a similarity function that computes the similarity between two objects.

Since:
3.0
Author:
Justin Basilico

Method Summary
 DivergenceFunction<FromType,ToType> asDivergence()
          Converts the similarity function into a divergence function.
 double evaluate(FromType from, ToType to)
          Evaluates the similarity between the two given objects.
 

Method Detail

evaluate

double evaluate(FromType from,
                ToType to)
Evaluates the similarity between the two given objects. Similarity between two objects is high if those objects are similar and low if they are not similar. Typically, this is a value that is greater than or equal to zero that is higher the more similar two objects are. If the two types are the same, then the rule f(x, y) = f(y, x) must apply.

Parameters:
from - The object the similarity is from.
to - The object the similarity is to.
Returns:
The similarity between the two objects.

asDivergence

DivergenceFunction<FromType,ToType> asDivergence()
Converts the similarity function into a divergence function. A diverge

Returns:
The divergence function version of this similarity function.