edu.cmu.sphinx.linguist.util
Class HMMPool

java.lang.Object
  extended byedu.cmu.sphinx.linguist.util.HMMPool

public class HMMPool
extends java.lang.Object

The HMMPool provides the ability to manage units via small integer IDs. Context Independent units and context dependent units can be converted to an ID. IDs can be used to quickly retrieve a unit or an hmm associated with the unit. This class operates under the constraint that context sizes are exactly one, which is generally only valid for large vocabulary tasks.


Constructor Summary
HMMPool(AcousticModel model, java.util.logging.Logger logger, UnitManager unitManager)
          Constructs a HMMPool object.
 
Method Summary
 int buildID(int unitID, int leftID, int rightID)
          Builds an id from the given unit and its left and right unit ids
 void dumpInfo()
          Dumps out info about this pool
 HMM getHMM(int unitID, HMMPosition position)
          Given a unit id and a position, return the HMM associated with the unit/position
 int getID(Unit unit)
          given a unit return its ID
 AcousticModel getModel()
           
 int getNumCIUnits()
          Returns the number of CI units
 Unit getUnit(int unitID)
          Gets the unit for the given id
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HMMPool

public HMMPool(AcousticModel model,
               java.util.logging.Logger logger,
               UnitManager unitManager)
Constructs a HMMPool object.

Parameters:
model - the model to use for the pool
Method Detail

getModel

public AcousticModel getModel()

getNumCIUnits

public int getNumCIUnits()
Returns the number of CI units

Returns:
the number of CI Units

getUnit

public Unit getUnit(int unitID)
Gets the unit for the given id

Parameters:
unitID - the id for the unit
Returns:
the unit associated with the ID

getHMM

public final HMM getHMM(int unitID,
                        HMMPosition position)
Given a unit id and a position, return the HMM associated with the unit/position

Parameters:
unitID - the id of the unit
position - the position within the word
Returns:
the hmm associated with the unit/position

getID

public int getID(Unit unit)
given a unit return its ID

Parameters:
unit - the unit
Returns:
an ID

buildID

public int buildID(int unitID,
                   int leftID,
                   int rightID)
Builds an id from the given unit and its left and right unit ids

Parameters:
unitID - the id of the central unit
leftID - the id of the left context unit
rightID - the id of the right context unit
Returns:
the id for the context dependent unit

dumpInfo

public void dumpInfo()
Dumps out info about this pool