com.wcohen.ss
Class MongeElkan

java.lang.Object
  extended by com.wcohen.ss.AbstractStringDistance
      extended by com.wcohen.ss.AffineGap
          extended by com.wcohen.ss.MongeElkan
All Implemented Interfaces:
StringDistance, StringDistanceLearner

public class MongeElkan
extends AffineGap

The match method proposed by Monge and Elkan. They called this Smith-Waterman, but actually, this uses an affine gap model, so it's not Smith-Waterman at all, according to the terminology in Durban, Sec 2.3. Costs are as follows: mismatched char = -3, match = +5 (case insensitive), approximate match = +3, for pairings in {dt} {gj} {lr} {mn} {bpv} {aeiou} {,.}, start gap = +5, continue gap = +1


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wcohen.ss.AffineGap
AffineGap.MatrixTrio
 
Constructor Summary
MongeElkan()
           
 
Method Summary
 java.lang.String explainScore(StringWrapper s, StringWrapper t)
          Version where distance which is possibly scaled to [0,1].
static void main(java.lang.String[] argv)
           
 double score(StringWrapper s, StringWrapper t)
          Version of distance which is possibly scaled to [0,1].
 void setScaling(boolean flag)
          If scaling is true, then distances are scaled to 0-1
 void setScaling(java.lang.Double flag)
          For interfacing with reflection in MatchExptScript.
 java.lang.String toString()
           
 
Methods inherited from class com.wcohen.ss.AbstractStringDistance
addExample, doMain, explainScore, getDistance, hasNextQuery, nextQuery, prepare, prepare, prepare, score, setDistanceInstancePool, setStringWrapperPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MongeElkan

public MongeElkan()
Method Detail

setScaling

public void setScaling(boolean flag)
If scaling is true, then distances are scaled to 0-1


setScaling

public void setScaling(java.lang.Double flag)
For interfacing with reflection in MatchExptScript. Scaling is true iff flag!=0.


toString

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

score

public double score(StringWrapper s,
                    StringWrapper t)
Version of distance which is possibly scaled to [0,1].

Specified by:
score in interface StringDistance
Overrides:
score in class AffineGap

explainScore

public java.lang.String explainScore(StringWrapper s,
                                     StringWrapper t)
Version where distance which is possibly scaled to [0,1].

Specified by:
explainScore in interface StringDistance
Overrides:
explainScore in class AffineGap

main

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