com.wcohen.ss
Class AbstractTokenizedStringDistance
java.lang.Object
com.wcohen.ss.AbstractStringDistance
com.wcohen.ss.AbstractTokenizedStringDistance
- All Implemented Interfaces:
- StringDistance, StringDistanceLearner
- Direct Known Subclasses:
- AbstractStatisticalTokenDistance, JensenShannonDistance, Level2
public abstract class AbstractTokenizedStringDistance
- extends AbstractStringDistance
Abstract distance metric for tokenized strings.
Methods inherited from class com.wcohen.ss.AbstractStringDistance |
addExample, doMain, explainScore, explainScore, getDistance, hasNextQuery, nextQuery, prepare, prepare, score, score, setDistanceInstancePool |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tokenizer
protected Tokenizer tokenizer
AbstractTokenizedStringDistance
public AbstractTokenizedStringDistance(Tokenizer tokenizer)
AbstractTokenizedStringDistance
public AbstractTokenizedStringDistance()
setStringWrapperPool
public final void setStringWrapperPool(StringWrapperIterator i)
- Description copied from class:
AbstractStringDistance
- Implements the StringDistanceLearner api, by providing a way to
accumulate statistics for a set of related strings. This is for
distance metrics like TFIDF that use statistics on unlabeled
strings to adjust a distance metric. The Default is to do
nothing; override this method if it's necessary to accumulate
statistics.
- Specified by:
setStringWrapperPool
in interface StringDistanceLearner
- Overrides:
setStringWrapperPool
in class AbstractStringDistance
train
public abstract void train(StringWrapperIterator i)
prepare
public final StringWrapperIterator prepare(StringWrapperIterator i)
- Description copied from class:
AbstractStringDistance
- Implements StringDistanceLearner api by providing a way to prep a
StringWrapperIterator for training. By default this makes no
changes to the iterator.
- Specified by:
prepare
in interface StringDistanceLearner
- Overrides:
prepare
in class AbstractStringDistance
asBagOfTokens
protected final com.wcohen.ss.BagOfTokens asBagOfTokens(StringWrapper w)