edu.stanford.nlp.mt
Class ATableHMM2EQ

java.lang.Object
  |
  +--edu.stanford.nlp.mt.ATable
        |
        +--edu.stanford.nlp.mt.ATableHMM2EQ

public class ATableHMM2EQ
extends ATable


Constructor Summary
ATableHMM2EQ()
           
ATableHMM2EQ(int maxsize)
           
 
Method Summary
 boolean checkOK()
           
 boolean checkOK(int len)
          Check OK for a specific length len
 double DKL(ATableHMM a)
           
 float getEmpty()
           
 float getInitialProb(int index, int l)
          Get the initial probability p(i|l) i is in 0..l , l is the length of the english sentence
 float getProb(int i, int i_prev, int i_prev2, int l)
          Smooth the basic probability if smoothUniform is on
 float getProbHMM(int i, int i_prev, int j_prev2, int l)
          Get the probability p(i|i_prev,i_prev2,l) i is from 1 to 2L+1 and i_prev,i_prev2 are in the same set as well without 2L+1
 float getProbJump(int distance, int distance1)
          Get the prior probability of jumping a distance distance
 void incCount(int distance, int distance1, float cnt)
          Increment the count for a jump of distance distance
 void incCount(int i, int i_prev, int i_prev2, int l, double val1)
          Increment the corresponding counts
 void incCountInitPos(int i, float cnt)
          Increment the count for an initial jump to position I
 void incEmpty(int absjump, float cnt)
          Increment the count for a zero jump with cnt
 void initialize(ATable a1)
           
 void initializeUniform()
          Initialize the probabilities in a brain dead manner uniformly
 boolean isPopulated()
           
 boolean isToNull(int jump)
           
 int jump(int i, int i_p, int l)
           
 float Mabs(float x)
           
static void main(String[] args)
          Some code to test the class
 void normalize()
          This does the normalization of the component distributions
 void normalizeInitialProbs()
          Calculate normalized initial parameters from the counts in initialCounts This assumes we already have pEmpty calculated from params First, normalizes initialCounts so that p(1)+ ..p(MAX_LENGTH)+p0 is 1
 void normalizeProbArr()
          Normalize the transition table prob_arr and put the appropriate probabilities there
 boolean possibleExternal(int i_prev, int jump, int l)
           
 boolean possibleInternal(int i_prev, int jump, int l)
           
 void printBasicProbs()
           
 void printProbs()
           
 void read(String filename)
          reading the jump probabilities and initializing
 void readHMM1(String filename)
          reading the jump probabilities from an HMM1 file and initializing
 void save(String filename)
          Saving just the jump probabilities
 void zeroCounts()
          Before starting a new iteration the counts should be zero-ed
 
Methods inherited from class edu.stanford.nlp.mt.ATable
DKL, getCount, getProb, incCount, incCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ATableHMM2EQ

public ATableHMM2EQ(int maxsize)

ATableHMM2EQ

public ATableHMM2EQ()
Method Detail

getInitialProb

public float getInitialProb(int index,
                            int l)
Get the initial probability p(i|l) i is in 0..l , l is the length of the english sentence


isPopulated

public boolean isPopulated()
Overrides:
isPopulated in class ATable

getProbHMM

public float getProbHMM(int i,
                        int i_prev,
                        int j_prev2,
                        int l)
Get the probability p(i|i_prev,i_prev2,l) i is from 1 to 2L+1 and i_prev,i_prev2 are in the same set as well without 2L+1


isToNull

public boolean isToNull(int jump)

possibleExternal

public boolean possibleExternal(int i_prev,
                                int jump,
                                int l)

possibleInternal

public boolean possibleInternal(int i_prev,
                                int jump,
                                int l)

getProb

public float getProb(int i,
                     int i_prev,
                     int i_prev2,
                     int l)
Smooth the basic probability if smoothUniform is on

Overrides:
getProb in class ATable

incCount

public void incCount(int i,
                     int i_prev,
                     int i_prev2,
                     int l,
                     double val1)
Increment the corresponding counts

Overrides:
incCount in class ATable

incCount

public void incCount(int distance,
                     int distance1,
                     float cnt)
Increment the count for a jump of distance distance


getProbJump

public float getProbJump(int distance,
                         int distance1)
Get the prior probability of jumping a distance distance


incEmpty

public void incEmpty(int absjump,
                     float cnt)
Increment the count for a zero jump with cnt


incCountInitPos

public void incCountInitPos(int i,
                            float cnt)
Increment the count for an initial jump to position I


normalizeInitialProbs

public void normalizeInitialProbs()
Calculate normalized initial parameters from the counts in initialCounts This assumes we already have pEmpty calculated from params First, normalizes initialCounts so that p(1)+ ..p(MAX_LENGTH)+p0 is 1


zeroCounts

public void zeroCounts()
Before starting a new iteration the counts should be zero-ed


normalizeProbArr

public void normalizeProbArr()
Normalize the transition table prob_arr and put the appropriate probabilities there


normalize

public void normalize()
This does the normalization of the component distributions

Overrides:
normalize in class ATable

initializeUniform

public void initializeUniform()
Initialize the probabilities in a brain dead manner uniformly

Overrides:
initializeUniform in class ATable

initialize

public void initialize(ATable a1)
Overrides:
initialize in class ATable

getEmpty

public float getEmpty()
Overrides:
getEmpty in class ATable

checkOK

public boolean checkOK()
Overrides:
checkOK in class ATable

checkOK

public boolean checkOK(int len)
Check OK for a specific length len


jump

public int jump(int i,
                int i_p,
                int l)

printProbs

public void printProbs()
Overrides:
printProbs in class ATable

printBasicProbs

public void printBasicProbs()

Mabs

public float Mabs(float x)

main

public static void main(String[] args)
Some code to test the class


save

public void save(String filename)
Saving just the jump probabilities

Overrides:
save in class ATable

DKL

public double DKL(ATableHMM a)

read

public void read(String filename)
reading the jump probabilities and initializing


readHMM1

public void readHMM1(String filename)
reading the jump probabilities from an HMM1 file and initializing



Stanford NLP Group