com.wcohen.ss
Class ApproxNeedlemanWunsch

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

public class ApproxNeedlemanWunsch
extends AbstractStringDistance

Needleman-Wunsch string distance, following Durban et al. Sec 2.3, but using an approximate string distance.


Constructor Summary
ApproxNeedlemanWunsch()
           
ApproxNeedlemanWunsch(CharMatchScore charMatchScore, double gapCost)
           
 
Method Summary
 java.lang.String explainScore(StringWrapper s, StringWrapper t)
          This method needs to be implemented by subclasses.
 int getAlignedChar(int iMinusOne, boolean preferHigherIndices)
          Find a character in the first string, s, that can be aligned with the i-th character in the second string, t.
static void main(java.lang.String[] argv)
           
 double score(StringWrapper s, StringWrapper t)
          This method needs to be implemented by subclasses.
 void setWidth(int w)
           
 
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, toString, wait, wait, wait
 

Constructor Detail

ApproxNeedlemanWunsch

public ApproxNeedlemanWunsch()

ApproxNeedlemanWunsch

public ApproxNeedlemanWunsch(CharMatchScore charMatchScore,
                             double gapCost)
Method Detail

setWidth

public void setWidth(int w)

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

explainScore

public java.lang.String explainScore(StringWrapper s,
                                     StringWrapper t)
Description copied from class: AbstractStringDistance
This method needs to be implemented by subclasses.

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

getAlignedChar

public int getAlignedChar(int iMinusOne,
                          boolean preferHigherIndices)
Find a character in the first string, s, that can be aligned with the i-th character in the second string, t.


main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Throws:
java.lang.Exception