com.wcohen.secondstring
Class JelinekMercerJS

java.lang.Object
  |
  +--com.wcohen.secondstring.AbstractStringDistance
        |
        +--com.wcohen.secondstring.JensenShannonDistance
              |
              +--com.wcohen.secondstring.JelinekMercerJS
All Implemented Interfaces:
StringDistance

public class JelinekMercerJS
extends JensenShannonDistance

Jensen-Shannon distance of two unigram language models, smoothed using Jelinek-Mercer mixture model.


Constructor Summary
JelinekMercerJS()
           
JelinekMercerJS(Tokenizer tokenizer, double lambda)
           
 
Method Summary
 double getLambda()
           
static void main(java.lang.String[] argv)
           
 void setLambda(double lambda)
           
 void setLambda(java.lang.Double lambda)
           
protected  double smoothedProbability(Token tok, double freq, double totalWeight)
          smoothed probability of the token
 java.lang.String toString()
           
 
Methods inherited from class com.wcohen.secondstring.JensenShannonDistance
accumulateStatistics, backgroundProb, explainScore, prepare, score
 
Methods inherited from class com.wcohen.secondstring.AbstractStringDistance
doMain, explainScore, score
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JelinekMercerJS

public JelinekMercerJS(Tokenizer tokenizer,
                       double lambda)

JelinekMercerJS

public JelinekMercerJS()
Method Detail

getLambda

public double getLambda()

setLambda

public void setLambda(double lambda)

setLambda

public void setLambda(java.lang.Double lambda)

smoothedProbability

protected double smoothedProbability(Token tok,
                                     double freq,
                                     double totalWeight)
smoothed probability of the token

Specified by:
smoothedProbability in class JensenShannonDistance

toString

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

main

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