be.ac.ulg.montefiore.run.jahmm.io
Class OpdfIntegerReader

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.io.OpdfReader<OpdfInteger>
      extended by be.ac.ulg.montefiore.run.jahmm.io.OpdfIntegerReader

public class OpdfIntegerReader
extends OpdfReader<OpdfInteger>

This class implements a OpdfInteger reader. The syntax of the distribution description is the following.

The description always begins with the keyword IntegerOPDF. The next (resp. last) symbol is an opening (resp. closing) bracket. Between the backets is a list of numbers separated by a space. The i-th number is the probability of i-1.

For example, reading IntegerOPDF [ .2 .3 .5 ] returns a distribution equivalent to new OpdfInteger(new double[] { .2 .3 .5 }).


Constructor Summary
OpdfIntegerReader()
          Implements a reader of distributions over integer observations.
OpdfIntegerReader(int nbEntries)
          Implements a reader of distributions over integer observations.
 
Method Summary
 OpdfInteger read(java.io.StreamTokenizer st)
          Reads an Opdf out of a StreamTokenizer.
 
Methods inherited from class be.ac.ulg.montefiore.run.jahmm.io.OpdfReader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpdfIntegerReader

public OpdfIntegerReader()
Implements a reader of distributions over integer observations.


OpdfIntegerReader

public OpdfIntegerReader(int nbEntries)
Implements a reader of distributions over integer observations. The number of probabilities given is checked.

Parameters:
nbEntries - The number of entries that should be found (i.e. a FileFormatException is triggered if the read opdf is not such as opdf.nbEntries() == nbEntries ).
Method Detail

read

public OpdfInteger read(java.io.StreamTokenizer st)
                 throws java.io.IOException,
                        FileFormatException
Description copied from class: OpdfReader
Reads an Opdf out of a StreamTokenizer.

The stream tokenizer syntax table must be set according to of HmmReader.initSyntaxTable(StreamTokenizer) before the call to this method and reset to this state if modified before it returns.

Specified by:
read in class OpdfReader<OpdfInteger>
Parameters:
st - A stream tokenizer.
Returns:
An Opdf.
Throws:
java.io.IOException
FileFormatException


Copyright © 2004,2005 Jean-Marc François.