|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.wcohen.secondstring.AbstractStringDistance
|
+--com.wcohen.secondstring.SLIM
The same-letter index mixture distance.
Experimental, invented by William Cohen. Ahem. Ahem. Which is mine.
Represents a pair S=a1...aK, T=b1...bK as a set of index distances D = { i-j : ai=bj }, and models this set D as a mixture of two Gaussians, one with small variance (so i~=j) and one with large variance (so i!=j). The degree of overlap for two chars ai and bj such that ai=bj is the posterior probability of the small-variance Gaussian, given i-j. Distance is average overlap between the two strings.
| Constructor Summary | |
SLIM()
|
|
| Method Summary | |
java.lang.String |
explainScore(StringWrapper s,
StringWrapper t)
This method needs to be implemented by subclasses. |
static void |
main(java.lang.String[] argv)
|
StringWrapper |
prepare(java.lang.String s)
Default way to preprocess a string for distance computation. |
double |
score(StringWrapper s,
StringWrapper t)
This method needs to be implemented by subclasses. |
java.lang.String |
toString()
|
| Methods inherited from class com.wcohen.secondstring.AbstractStringDistance |
accumulateStatistics, doMain, explainScore, score |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SLIM()
| Method Detail |
public java.lang.String toString()
toString in class java.lang.Object
public double score(StringWrapper s,
StringWrapper t)
AbstractStringDistance
score in interface StringDistancescore in class AbstractStringDistance
public java.lang.String explainScore(StringWrapper s,
StringWrapper t)
AbstractStringDistance
explainScore in interface StringDistanceexplainScore in class AbstractStringDistancepublic StringWrapper prepare(java.lang.String s)
AbstractStringDistance
prepare in interface StringDistanceprepare in class AbstractStringDistancepublic static void main(java.lang.String[] argv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||