|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.jahmm.io.HmmReader
public class HmmReader
This class can read Hidden Markov Models represented as text files. The file syntax is as follows.
A '#' character induces a comment ; the rest of the line is skipped. Words must be separated with a white space (space, tab or new line). The file is case-sensitive. The file must begin with the words Hmm and v1.0.
The next word must be NbStates followed by a number. This number is the HMM's number of states.
Then comes a description of each state. The n-th description is related to the n-th state. A state description begins with the keywords State and Pi, followed by the initial probability of this state. Then comes the letter A followed by the state transition probabilities separated by a space, in the right order. Then comes a description of an observation distribution which depends on the type of observation handled by the HMM.
The opdfs associated with all the states must have the same type. A HMM description file thus looks like this:
# A simple Hmm Hmm v1.0 NbStates 2 State Pi 0.7 A 0.1 0.9 IntegerOPDF [ .2 .3 .4 .1 ] State Pi 0.3 A 0.4 0.6 IntegerOPDF [ .1 .1 .1 .7 ]The lines starting with 'IntegerOPDF' are distributions descriptions.
Constructor Summary | |
---|---|
HmmReader()
|
Method Summary | ||
---|---|---|
static
|
read(java.io.Reader reader,
OpdfReader<? extends Opdf<O>> opdfReader)
Reads a HMM from a text file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HmmReader()
Method Detail |
---|
public static <O extends Observation> Hmm<O> read(java.io.Reader reader, OpdfReader<? extends Opdf<O>> opdfReader) throws java.io.IOException, FileFormatException
reader
- The reader to read the HMM description from.opdfReader
- The OpdfReader
used to read the observation
distributions.
java.io.IOException
FileFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |