com.wcohen.ss
Class CombinedStringDistanceLearner.CombinedStringDistance

java.lang.Object
  extended by com.wcohen.ss.CombinedStringDistanceLearner.CombinedStringDistance
All Implemented Interfaces:
StringDistance
Enclosing class:
CombinedStringDistanceLearner

protected abstract class CombinedStringDistanceLearner.CombinedStringDistance
extends java.lang.Object
implements StringDistance

Abstract class for combining innerDistances's


Field Summary
protected  StringDistance[] innerDistances
           
protected  MultiStringWrapper prototype
           
 
Constructor Summary
CombinedStringDistanceLearner.CombinedStringDistance(StringDistance[] innerDistances, MultiStringWrapper prototype)
           
 
Method Summary
protected abstract  double doScore(MultiStringWrapper ms, MultiStringWrapper mt)
          Produce a score, assuming ms and mt are the correct sizes, and fully prepared.
protected abstract  java.lang.String explainCombination(MultiStringWrapper ms, MultiStringWrapper mt)
          Explain how the primitive scores were combined.
 java.lang.String explainScore(java.lang.String s, java.lang.String t)
          Explain how the distance was computed.
 java.lang.String explainScore(StringWrapper s, StringWrapper t)
          Explain how the distance was computed.
protected  java.lang.String innerDistanceString()
          Help class for 'toString()' which produces a description of the distances being combined.
 StringWrapper prepare(java.lang.String s)
          Preprocess a string for distance computation
 double score(java.lang.String s, java.lang.String t)
          Find the distance between s and t
 double score(StringWrapper s, StringWrapper t)
          Find the distance between s and t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

innerDistances

protected StringDistance[] innerDistances

prototype

protected MultiStringWrapper prototype
Constructor Detail

CombinedStringDistanceLearner.CombinedStringDistance

public CombinedStringDistanceLearner.CombinedStringDistance(StringDistance[] innerDistances,
                                                            MultiStringWrapper prototype)
Method Detail

score

public final double score(java.lang.String s,
                          java.lang.String t)
Description copied from interface: StringDistance
Find the distance between s and t

Specified by:
score in interface StringDistance

explainScore

public final java.lang.String explainScore(java.lang.String s,
                                           java.lang.String t)
Description copied from interface: StringDistance
Explain how the distance was computed.

Specified by:
explainScore in interface StringDistance

prepare

public final StringWrapper prepare(java.lang.String s)
Description copied from interface: StringDistance
Preprocess a string for distance computation

Specified by:
prepare in interface StringDistance

score

public final double score(StringWrapper s,
                          StringWrapper t)
Description copied from interface: StringDistance
Find the distance between s and t. Larger values indicate more similar strings.

Specified by:
score in interface StringDistance

explainScore

public final java.lang.String explainScore(StringWrapper s,
                                           StringWrapper t)
Description copied from interface: StringDistance
Explain how the distance was computed.

Specified by:
explainScore in interface StringDistance

doScore

protected abstract double doScore(MultiStringWrapper ms,
                                  MultiStringWrapper mt)
Produce a score, assuming ms and mt are the correct sizes, and fully prepared.


explainCombination

protected abstract java.lang.String explainCombination(MultiStringWrapper ms,
                                                       MultiStringWrapper mt)
Explain how the primitive scores were combined.


innerDistanceString

protected java.lang.String innerDistanceString()
Help class for 'toString()' which produces a description of the distances being combined.