com.wcohen.secondstring
Class DirichletJS

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

public class DirichletJS
extends JensenShannonDistance

Jensen-Shannon distance of two unigram language models, smoothed using Dirichlet prior.


Constructor Summary
DirichletJS()
           
DirichletJS(Tokenizer tokenizer, double pseudoCount)
           
 
Method Summary
 double getPseudoCount()
           
static void main(java.lang.String[] argv)
           
 void setPseudoCount(double c)
           
 void setPseudoCount(java.lang.Double c)
           
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

DirichletJS

public DirichletJS(Tokenizer tokenizer,
                   double pseudoCount)

DirichletJS

public DirichletJS()
Method Detail

getPseudoCount

public double getPseudoCount()

setPseudoCount

public void setPseudoCount(double c)

setPseudoCount

public void setPseudoCount(java.lang.Double c)

toString

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

smoothedProbability

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

Specified by:
smoothedProbability in class JensenShannonDistance

main

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