public abstract class SentenceHMMState extends java.lang.Object implements java.io.Serializable, SearchState
Modifier and Type | Class and Description |
---|---|
static class |
SentenceHMMState.Color
A Color is used to tag SentenceHMM nodes
|
Modifier | Constructor and Description |
---|---|
protected |
SentenceHMMState()
Empty contructor
|
protected |
SentenceHMMState(java.lang.String name,
SentenceHMMState parent,
int which)
Creates a SentenceHMMState
|
Modifier and Type | Method and Description |
---|---|
static java.util.Set<SentenceHMMState> |
collectStates(SentenceHMMState start)
Collect all states starting from the given start state
|
void |
connect(SentenceHMMStateArc arc)
Connects the arc to this sentence hmm.
|
void |
dumpAll()
Dumps this SentenceHMMState and all its successors.
|
SentenceHMMStateArc |
findArc(SentenceHMMState state)
Searches the set of arcs for an arc that points to a state with an identical value
|
protected java.lang.String |
getAnnotation()
Returns any annotation for this state
|
Word |
getAssociatedWord()
Returns the word associated with the particular unit
|
SentenceHMMState.Color |
getColor()
Gets the color for this node
|
java.lang.String |
getFullName()
Gets the fullName for this state
|
SentenceHMMState |
getLexState()
Returns the lextree state
|
java.lang.String |
getName()
Gets the name for this state
|
int |
getNumSuccessors()
Gets the number of successors
|
abstract int |
getOrder()
Returns the order of this particular state
|
SentenceHMMState |
getParent()
Retrieves the parent sate
|
java.lang.String |
getPrettyName()
Returns a pretty name for this HMM
|
java.lang.String |
getSignature()
Gets the signature for this state
|
SearchStateArc[] |
getSuccessors()
Gets a successor to this search state
|
java.lang.String |
getTitle()
gets the title (fullname + stateNumber) for this state
|
java.lang.String |
getTypeLabel()
Retrieves a short label describing the type of this state.
|
java.lang.String |
getValueSignature()
Returns the value signature of this unit
|
int |
getWhich()
Retrieves the index for this state words
|
WordSequence |
getWordHistory()
Gets the word history for this state.
|
boolean |
isEmitting()
Determines if this state is an emitting state
|
boolean |
isFanIn()
Determines if this state is a fan-in state.
|
boolean |
isFinal()
Determines if this is a final state
|
boolean |
isProcessed()
Determines if this state has been 'processed'.
|
boolean |
isSharedState()
Determines if this state is a shard state
|
boolean |
isUnit()
Determines if this state is a unit state
|
boolean |
isWordStart()
Determines if this state marks the beginning of a word
|
void |
resetAllProcessed()
Reset process flags for this state and all successor states
|
void |
setColor(SentenceHMMState.Color color)
Sets the color for this node
|
void |
setFanIn(boolean fanIn)
Sets the fan in state
|
void |
setFinalState(boolean state)
Sets this is to be final state
|
void |
setProcessed(boolean processed)
Sets the processed flag for this state
|
void |
setSharedState(boolean shared)
Sets the shared state flag
|
void |
setWhich(int which)
Sets the index for this state
|
void |
setWordStart(boolean wordStart)
Sets the 'wordStart' flag
|
java.lang.String |
toPrettyString()
Returns a pretty version of the string representation for this object
|
java.lang.String |
toString()
Returns the string representation of this object
|
void |
validateAll()
Validates this SentenceHMMState and all successors
|
static boolean |
visitStates(edu.cmu.sphinx.linguist.flat.SentenceHMMStateVisitor visitor,
SentenceHMMState start,
boolean sorted)
Visit all of the states starting at start with the given vistor
|
protected SentenceHMMState(java.lang.String name, SentenceHMMState parent, int which)
name
- the name of the current SentenceHMMStateparent
- the parent of the current instancewhich
- the index of the current instanceprotected SentenceHMMState()
public boolean isWordStart()
public void setWordStart(boolean wordStart)
wordStart
- true
if this state marks the beginning of a word.public boolean isSharedState()
public void setSharedState(boolean shared)
shared
- true
if this state is sharedpublic Word getAssociatedWord()
public java.lang.String getTypeLabel()
public boolean isFanIn()
true
if the state is a fan in statepublic void setFanIn(boolean fanIn)
fanIn
- if true its a fan in statepublic void setProcessed(boolean processed)
processed
- the new setting for the processed flagpublic boolean isProcessed()
public void resetAllProcessed()
public WordSequence getWordHistory()
getWordHistory
in interface SearchState
public int getNumSuccessors()
public SearchStateArc[] getSuccessors()
getSuccessors
in interface SearchState
public SentenceHMMState getLexState()
getLexState
in interface SearchState
public void connect(SentenceHMMStateArc arc)
arc
- the path to the next statepublic boolean isEmitting()
isEmitting
in interface SearchState
public boolean isFinal()
isFinal
in interface SearchState
public void setFinalState(boolean state)
state
- true if this is a final statepublic boolean isUnit()
true
if the state is a unit state.public void dumpAll()
protected java.lang.String getAnnotation()
public void validateAll()
public java.lang.String getName()
public java.lang.String getPrettyName()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toPrettyString()
SearchState
toPrettyString
in interface SearchState
public java.lang.String getFullName()
public java.lang.String getSignature()
getSignature
in interface SearchState
public java.lang.String getTitle()
public int getWhich()
public void setWhich(int which)
which
- the index for this statepublic SentenceHMMState getParent()
public SentenceHMMStateArc findArc(SentenceHMMState state)
state
- the state to search forpublic java.lang.String getValueSignature()
public static boolean visitStates(edu.cmu.sphinx.linguist.flat.SentenceHMMStateVisitor visitor, SentenceHMMState start, boolean sorted)
visitor
- the state visitorstart
- the place to start the searchsorted
- if true, states are sorted before visitedpublic void setColor(SentenceHMMState.Color color)
color
- the color of this nodepublic SentenceHMMState.Color getColor()
public static java.util.Set<SentenceHMMState> collectStates(SentenceHMMState start)
start
- the state to start the search frompublic abstract int getOrder()
getOrder
in interface SearchState