|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.wcohen.ss.MultiStringDistance
public abstract class MultiStringDistance
Abstract class StringDistance defined over Strings that are broken into fields. This could actually be used in several ways:
Constructor Summary | |
---|---|
MultiStringDistance(java.lang.String delim)
|
Method Summary | |
---|---|
protected MultiStringWrapper |
asMultiStringWrapper(StringWrapper w)
Lazily prepare a string. |
protected static void |
doMain(StringDistance d,
java.lang.String[] argv)
Default main routine for testing |
java.lang.String |
explainScore(java.lang.String s,
java.lang.String t)
Scores are explained by converting Strings to StringWrappers with the prepare function. |
java.lang.String |
explainScore(StringWrapper s,
StringWrapper t)
Explain how the distance was computed. |
protected abstract java.lang.String |
explainScoreCombination(double[] multiScore)
Explain how to combine the scores for each primitive distance function on each field. |
protected abstract StringDistance |
getDistance(int i)
Get the distance used for the i-th pair of fields |
protected boolean |
isLegalMultiStringWrapperSize(int n)
Check if a string has a valid number of fields. |
StringWrapper |
prepare(java.lang.String s)
Prepare a string. |
double |
score(java.lang.String s,
java.lang.String t)
Strings are scored by converting them to StringWrappers with the prepare function. |
double |
score(StringWrapper s,
StringWrapper t)
Find the distance between s and t. |
protected abstract double |
scoreCombination(double[] multiScore)
Combine the scores for each primitive distance function on each field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiStringDistance(java.lang.String delim)
Method Detail |
---|
public final double score(StringWrapper s, StringWrapper t)
StringDistance
score
in interface StringDistance
protected abstract double scoreCombination(double[] multiScore)
public final java.lang.String explainScore(StringWrapper s, StringWrapper t)
StringDistance
explainScore
in interface StringDistance
protected abstract java.lang.String explainScoreCombination(double[] multiScore)
public final double score(java.lang.String s, java.lang.String t)
score
in interface StringDistance
public final java.lang.String explainScore(java.lang.String s, java.lang.String t)
explainScore
in interface StringDistance
public final StringWrapper prepare(java.lang.String s)
prepare
in interface StringDistance
protected MultiStringWrapper asMultiStringWrapper(StringWrapper w)
protected abstract StringDistance getDistance(int i)
protected boolean isLegalMultiStringWrapperSize(int n)
protected static final void doMain(StringDistance d, java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |