Jet.HMM
Class SuffixHMMemitter

java.lang.Object
  extended byJet.HMM.HMMemitter
      extended byJet.HMM.SuffixHMMemitter

public class SuffixHMMemitter
extends HMMemitter

an HMMemitter, using statistics for exact token match (including case), for token match (ignoring case), for suffix, and for word 'shape'. Warning: this class uses static variables for counts associated with the entire HMM, so it should only be used for a single HMM.


Field Summary
 
Fields inherited from class Jet.HMM.HMMemitter
hmm, stateName
 
Constructor Summary
SuffixHMMemitter()
           
 
Method Summary
 void computeProbabilities()
          computate probabilities of emission from counts.
 double getProbability(java.lang.String token, java.lang.String priorToken, FeatureSet fs)
          returns the probability that the current HMM state will emit token token with FeatureSet fs.
 void print()
          print the information about emission from this state to System.out.
 void resetForTraining()
          initialize the emitter prior to training.
 void setCacheCount(java.lang.String type, int n)
           
 void store(java.io.PrintWriter stream)
          write the information about emission from this state in a form which can be read by HMM.load(java.io.Reader).
 void trainOnInstances(java.lang.String token, java.lang.String priorToken, int n)
          update emission counts to indicate that String token appeared n times as an output of the current state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuffixHMMemitter

public SuffixHMMemitter()
Method Detail

resetForTraining

public void resetForTraining()
Description copied from class: HMMemitter
initialize the emitter prior to training. This method should be called before any calls on HMMemitter.trainOnInstances(java.lang.String, java.lang.String, int).

Specified by:
resetForTraining in class HMMemitter

setCacheCount

public void setCacheCount(java.lang.String type,
                          int n)
Overrides:
setCacheCount in class HMMemitter

trainOnInstances

public void trainOnInstances(java.lang.String token,
                             java.lang.String priorToken,
                             int n)
Description copied from class: HMMemitter
update emission counts to indicate that String token appeared n times as an output of the current state.

Specified by:
trainOnInstances in class HMMemitter

computeProbabilities

public void computeProbabilities()
Description copied from class: HMMemitter
computate probabilities of emission from counts. This method will be called after all calls on HMMemitter.trainOnInstances(java.lang.String, java.lang.String, int) and before calls on HMMemitter.getProbability(java.lang.String, java.lang.String, Jet.Lisp.FeatureSet).

Specified by:
computeProbabilities in class HMMemitter

getProbability

public double getProbability(java.lang.String token,
                             java.lang.String priorToken,
                             FeatureSet fs)
Description copied from class: HMMemitter
returns the probability that the current HMM state will emit token token with FeatureSet fs.

Specified by:
getProbability in class HMMemitter

print

public void print()
Description copied from class: HMMemitter
print the information about emission from this state to System.out.

Specified by:
print in class HMMemitter

store

public void store(java.io.PrintWriter stream)
Description copied from class: HMMemitter
write the information about emission from this state in a form which can be read by HMM.load(java.io.Reader).

Specified by:
store in class HMMemitter