edu.cmu.sphinx.linguist.flat
Class UnitState

java.lang.Object
  extended byedu.cmu.sphinx.linguist.flat.SentenceHMMState
      extended byedu.cmu.sphinx.linguist.flat.UnitState
All Implemented Interfaces:
SearchState, java.io.Serializable, UnitSearchState
Direct Known Subclasses:
ExtendedUnitState, ParallelUnitState

public class UnitState
extends SentenceHMMState
implements UnitSearchState

Represents a unit in an SentenceHMMS

See Also:
Serialized Form

Constructor Summary
UnitState(PronunciationState parent, int which, Unit unit)
          Creates a UnitState.
UnitState(Unit unit, HMMPosition position)
          Creates a UnitState with the given unit and HMM position.
 
Method Summary
 java.lang.String getName()
          Gets the name for this state
 int getOrder()
          Returns the state order for this state type
 HMMPosition getPosition()
          Gets the position for this unit
 java.lang.String getPrettyName()
          Gets the pretty name for this unit sate
 StatePath getTail()
          Returns the tail for this unit state.
 java.lang.String getTypeLabel()
          Retrieves a short label describing the type of this state.
 Unit getUnit()
          Gets the unit associated with this state
 java.lang.String getValueSignature()
          Returns the value signature of this unit
 boolean isLast()
          Returns true if this unit is the last unit of the pronunciation
 boolean isUnit()
          Determines if this state is a unit state
 void setTail(StatePath tail)
          Sets the tail for this state
 
Methods inherited from class edu.cmu.sphinx.linguist.flat.SentenceHMMState
collectStates, connect, dumpAll, findArc, getAssociatedWord, getColor, getFullName, getLexState, getNumSuccessors, getParent, getSignature, getSuccessors, getTitle, getWhich, getWordHistory, isEmitting, isFanIn, isFinal, isProcessed, isSharedState, isWordStart, resetAllProcessed, setColor, setFanIn, setFinalState, setProcessed, setSharedState, setWhich, setWordStart, toPrettyString, toString, validateAll, visitStates
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.cmu.sphinx.linguist.SearchState
getLexState, getSignature, getSuccessors, getWordHistory, isEmitting, isFinal, toPrettyString
 

Constructor Detail

UnitState

public UnitState(PronunciationState parent,
                 int which,
                 Unit unit)
Creates a UnitState. Gets the left and right contexts from the unit itself.

Parameters:
parent - the parent state
which - the index of the given state
unit - the unit associated with this state

UnitState

public UnitState(Unit unit,
                 HMMPosition position)
Creates a UnitState with the given unit and HMM position.

Parameters:
unit - the unit associated with this state
position - the HMM position of this unit
Method Detail

getUnit

public Unit getUnit()
Gets the unit associated with this state

Specified by:
getUnit in interface UnitSearchState
Returns:
the unit

isLast

public boolean isLast()
Returns true if this unit is the last unit of the pronunciation

Returns:
true if the unit is the last unit

getName

public java.lang.String getName()
Gets the name for this state

Overrides:
getName in class SentenceHMMState
Returns:
the name for this state

getValueSignature

public java.lang.String getValueSignature()
Returns the value signature of this unit

Overrides:
getValueSignature in class SentenceHMMState
Returns:
the value signature

getPrettyName

public java.lang.String getPrettyName()
Gets the pretty name for this unit sate

Overrides:
getPrettyName in class SentenceHMMState
Returns:
the pretty name

getTypeLabel

public java.lang.String getTypeLabel()
Retrieves a short label describing the type of this state. Typically, subclasses of SentenceHMMState will implement this method and return a short (5 chars or less) label

Overrides:
getTypeLabel in class SentenceHMMState
Returns:
the short label.

getPosition

public HMMPosition getPosition()
Gets the position for this unit

Returns:
the position for this unit

getTail

public StatePath getTail()
Returns the tail for this unit state. This is used during the SentenceHMM contruction process. A UnitState may be expanded into a unit state followed by a tree of HMMStates. Keeping the tail of the tree here helps us to quickly find the end of this collection of states when we are reusing states.

Returns:
the tail state

setTail

public void setTail(StatePath tail)
Sets the tail for this state

Parameters:
tail - the tail for the state

isUnit

public boolean isUnit()
Description copied from class: SentenceHMMState
Determines if this state is a unit state

Overrides:
isUnit in class SentenceHMMState
Returns:
true if the state is a unit state.

getOrder

public int getOrder()
Returns the state order for this state type

Specified by:
getOrder in interface SearchState
Specified by:
getOrder in class SentenceHMMState
Returns:
the state order