|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.decoder.search.Token
public class Token
Represents a single state in the recognition trellis. Subclasses of a token are used to represent the various emitting state.
All scores are maintained in LogMath log base
Field Summary | |
---|---|
static java.util.Comparator<Token> |
COMPARATOR
a token comparator that is used to order tokens in descending order |
Constructor Summary | |
---|---|
Token(float logAcousticScore,
float logLanguageScore,
Token predecessor)
Creates a Token with the given acoustic and language scores and predecessor. |
|
Token(SearchState state,
int frameNumber)
Creates the initial token with the given word history depth |
Method Summary | |
---|---|
float |
calculateScore(Data feature)
Calculates a score against the given feature. |
Token |
child(SearchState state,
float logTotalScore,
float logLanguageScore,
float logInsertionProbability,
int frameNumber)
Constructs a new token that continues the search from the current token. |
void |
dumpTokenPath()
dumps a branch of tokens |
void |
dumpTokenPath(boolean includeHMMStates)
dumps a branch of tokens |
float |
getAcousticScore()
Returns the acoustic score for this token (in logMath log base) |
Data |
getData()
Returns the feature for this Token. |
int |
getFrameNumber()
Returns the frame number for this token. |
float |
getInsertionProbability()
Returns the insertionPenalty associated with this token |
float |
getLanguageScore()
Returns the language score associated with this token |
int |
getLocation()
Returns the location of this Token in the ActiveList. |
Token |
getPredecessor()
Returns the predecessor for this token, or null if this token has no predecessors |
float |
getScore()
Returns the score for the token. |
SearchState |
getSearchState()
Returns the SearchState associated with this token |
java.util.Map<java.lang.String,java.lang.Object> |
getTokenProps()
Returns the application object |
Word |
getWord()
Returns the word of this Token, the search state is a WordSearchState. |
java.lang.String |
getWordPath()
Returns the string of words for this token, with embedded silences |
java.lang.String |
getWordPath(boolean wantFiller,
boolean wantPronunciations)
Returns the string of words leading up to this token. |
java.lang.String |
getWordPathNoFiller()
Returns the string of words for this token, with no embedded filler words |
java.lang.String |
getWordUnitPath()
Returns the string of words and units for this token, with embedded silences. |
float |
getWorkingScore()
Gets the working score. |
boolean |
isEmitting()
Determines if this token is associated with an emitting state. |
boolean |
isFinal()
Determines if this token is associated with a final SentenceHMM state. |
boolean |
isWord()
Determines if this token marks the end of a word |
float |
normalizeScore(float maxLogScore)
Normalizes a previously calculated score |
void |
setData(Data data)
Sets the feature for this Token. |
void |
setLocation(int location)
Sets the location of this Token in the ActiveList. |
static void |
setPredecessorClass(java.util.Set bpClasses)
Set the predecessor class. |
void |
setScore(float logScore)
Sets the score for this token |
void |
setWorkingScore(float logScore)
Sets the working score for this token |
static void |
showCount()
Shows the token count |
java.lang.String |
toString()
Retrieves the string representation of this object |
boolean |
validate()
Determines if this branch is valid |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.util.Comparator<Token> COMPARATOR
Constructor Detail |
---|
public Token(SearchState state, int frameNumber)
state
- the SearchState associated with this tokenframeNumber
- the frame number for this tokenpublic Token(float logAcousticScore, float logLanguageScore, Token predecessor)
logAcousticScore
- the log acoustic scorelogLanguageScore
- the log language scorepredecessor
- the predecessor TokenMethod Detail |
---|
public static void setPredecessorClass(java.util.Set bpClasses)
bpClasses
- public Token child(SearchState state, float logTotalScore, float logLanguageScore, float logInsertionProbability, int frameNumber)
state
- the SentenceHMMState associated with this tokenlogTotalScore
- the total entry score for this token (in LogMath log base)logLanguageScore
- the language score associated with this token (in LogMath log base)logInsertionProbability
- the insertion probabilty associated with this token (in LogMath log base)frameNumber
- the frame number associated with this tokenpublic Token getPredecessor()
public int getFrameNumber()
getFrameNumber
in interface Scoreable
public void setData(Data data)
public Data getData()
public float getScore()
getScore
in interface Scoreable
public float calculateScore(Data feature)
calculateScore
in interface Scoreable
feature
- the feature to be scored
public float normalizeScore(float maxLogScore)
normalizeScore
in interface Scoreable
maxLogScore
- the score to normalize this score with
public float getWorkingScore()
public void setWorkingScore(float logScore)
logScore
- the working score (in logMath log base)public void setScore(float logScore)
logScore
- the new score for the token (in logMath log base)public float getLanguageScore()
public float getInsertionProbability()
public float getAcousticScore()
public SearchState getSearchState()
public boolean isEmitting()
true
if this token is associated with an emitting statepublic boolean isFinal()
true
if this token is associated with a final statepublic boolean isWord()
true
if this token marks the end of a wordpublic java.lang.String toString()
toString
in class java.lang.Object
public void dumpTokenPath()
public void dumpTokenPath(boolean includeHMMStates)
includeHMMStates
- if true include all sentence hmm statespublic java.lang.String getWordPath(boolean wantFiller, boolean wantPronunciations)
wantFiller
- if true, filler words are addedwantPronunciations
- if true append [ phoneme phoneme ... ] after each word
public java.lang.String getWordPathNoFiller()
public java.lang.String getWordPath()
public java.lang.String getWordUnitPath()
public Word getWord()
public static void showCount()
public final int getLocation()
public final void setLocation(int location)
location
- the location of this Tokenpublic boolean validate()
public java.util.Map<java.lang.String,java.lang.Object> getTokenProps()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |