cbr.similarity
Class RankSimilarityMetric

java.lang.Object
  extended by cbr.similarity.RankSimilarityMetric
All Implemented Interfaces:
SimilarityMetric

public class RankSimilarityMetric
extends Object
implements SimilarityMetric

Very simple similarity metric that compares two alphabetical feature values Returns 1.0 if the characters are the same, otherwise returns 0.0 is they are different


Constructor Summary
RankSimilarityMetric()
           
 
Method Summary
 double compare(Feature f1, Feature f2)
          Compares two characters and assigns a similarity value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankSimilarityMetric

public RankSimilarityMetric()
Method Detail

compare

public double compare(Feature f1,
                      Feature f2)
Compares two characters and assigns a similarity value.

Specified by:
compare in interface SimilarityMetric
Parameters:
f1 - a feature that holds a character as it's value
f2 - a feature that holds a character as it's value
Returns:
double Returns 1.0 if the characters are the same, otherwise returns 0.0 is they are different