com.wcohen.ss
Class SoftTokenFelligiSunter

java.lang.Object
  extended by com.wcohen.ss.AbstractStringDistance
      extended by com.wcohen.ss.AbstractTokenizedStringDistance
          extended by com.wcohen.ss.AbstractStatisticalTokenDistance
              extended by com.wcohen.ss.SoftTokenFelligiSunter
All Implemented Interfaces:
StringDistance, StringDistanceLearner

public class SoftTokenFelligiSunter
extends AbstractStatisticalTokenDistance

Highly simplified model of Felligi-Sunter's method 1, applied to tokens.


Field Summary
 
Fields inherited from class com.wcohen.ss.AbstractStatisticalTokenDistance
collectionSize, documentFrequency, totalTokenCount
 
Fields inherited from class com.wcohen.ss.AbstractTokenizedStringDistance
tokenizer
 
Constructor Summary
SoftTokenFelligiSunter()
           
SoftTokenFelligiSunter(Tokenizer tokenizer, StringDistance tokenDistance, double tokenMatchThreshold, double mismatchFactor)
           
 
Method Summary
 java.lang.String explainScore(StringWrapper s, StringWrapper t)
          Explain how the distance was computed.
static void main(java.lang.String[] argv)
           
 StringWrapper prepare(java.lang.String s)
          Preprocess a string by finding tokens
 double score(StringWrapper s, StringWrapper t)
          This method needs to be implemented by subclasses.
 void setMismatchFactor(double d)
           
 void setMismatchFactor(java.lang.Double d)
           
 void setTokenMatchThreshold(double d)
           
 void setTokenMatchThreshold(java.lang.Double d)
           
 java.lang.String toString()
           
 
Methods inherited from class com.wcohen.ss.AbstractStatisticalTokenDistance
checkTrainingHasHappened, getDocumentFrequency, train
 
Methods inherited from class com.wcohen.ss.AbstractTokenizedStringDistance
asBagOfTokens, prepare, setStringWrapperPool
 
Methods inherited from class com.wcohen.ss.AbstractStringDistance
addExample, doMain, explainScore, getDistance, hasNextQuery, nextQuery, prepare, score, setDistanceInstancePool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SoftTokenFelligiSunter

public SoftTokenFelligiSunter(Tokenizer tokenizer,
                              StringDistance tokenDistance,
                              double tokenMatchThreshold,
                              double mismatchFactor)

SoftTokenFelligiSunter

public SoftTokenFelligiSunter()
Method Detail

setMismatchFactor

public void setMismatchFactor(double d)

setMismatchFactor

public void setMismatchFactor(java.lang.Double d)

setTokenMatchThreshold

public void setTokenMatchThreshold(double d)

setTokenMatchThreshold

public void setTokenMatchThreshold(java.lang.Double d)

score

public double score(StringWrapper s,
                    StringWrapper t)
Description copied from class: AbstractStringDistance
This method needs to be implemented by subclasses.

Specified by:
score in interface StringDistance
Specified by:
score in class AbstractStringDistance

prepare

public StringWrapper prepare(java.lang.String s)
Preprocess a string by finding tokens

Specified by:
prepare in interface StringDistance
Overrides:
prepare in class AbstractStringDistance

explainScore

public java.lang.String explainScore(StringWrapper s,
                                     StringWrapper t)
Explain how the distance was computed. In the output, the tokens in S and T are listed, and the common tokens are marked with an asterisk.

Specified by:
explainScore in interface StringDistance
Specified by:
explainScore in class AbstractStringDistance

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)