COMPARATOR
Constructor and Description |
---|
Token(SearchState state,
long collectTime)
Creates the initial token with the given word history depth
|
Token(Token predecessor,
float logTotalScore,
float logAcousticScore,
float logInsertionScore,
float logLanguageScore)
Creates a Token with the given acoustic and language scores and predecessor.
|
Token(Token predecessor,
SearchState state,
float logTotalScore,
float logInsertionScore,
float logLanguageScore,
long collectTime)
Internal constructor for a token.
|
Modifier and Type | Method and Description |
---|---|
float[] |
calculateComponentScore(Data feature) |
float |
calculateScore(Data feature)
Calculates a score against the given feature.
|
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).
|
long |
getCollectTime()
Collect time is different from frame number because some frames might be skipped in silence detector
|
Data |
getData()
Returns the feature for this Token.
|
float |
getInsertionScore()
Returns the insertion score associated with this token.
|
float |
getLanguageScore()
Returns the language score associated with this token
|
protected static java.text.DecimalFormat |
getNumberFormat()
Return the DecimalFormat object for formatting the print out of numbers
|
Token |
getPredecessor()
Returns the predecessor for this token, or null if this token has no predecessors
|
float |
getScore()
Returns the score for the token.
|
protected static java.text.DecimalFormat |
getScoreFormat()
Return the DecimalFormat object for formatting the print out of scores.
|
SearchState |
getSearchState()
Returns the SearchState associated with this token
|
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.
|
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 |
setScore(float logScore)
Sets the score for this token
|
static void |
showCount()
Shows the token count
|
java.lang.String |
toString()
Retrieves the string representation of this object
|
void |
update(Token predecessor,
SearchState nextState,
float logEntryScore,
float insertionProbability,
float languageProbability,
long collectTime) |
boolean |
validate()
Determines if this branch is valid
|
public Token(Token predecessor, SearchState state, float logTotalScore, float logInsertionScore, float logLanguageScore, long collectTime)
predecessor
- the predecessor for this tokenstate
- the SentenceHMMState associated with this tokenlogTotalScore
- the total entry score for this token (in LogMath log base)logInsertionScore
- the insertion score associated with this token (in LogMath log base)logLanguageScore
- the language score associated with this token (in LogMath log base)collectTime
- the frame collection timepublic Token(SearchState state, long collectTime)
state
- the SearchState associated with this tokencollectTime
- collection time of this tokenpublic Token(Token predecessor, float logTotalScore, float logAcousticScore, float logInsertionScore, float logLanguageScore)
predecessor
- previous tokenlogTotalScore
- total scorelogAcousticScore
- the log acoustic scorelogInsertionScore
- the log insertion scorelogLanguageScore
- the log language scorepublic Token getPredecessor()
public long getCollectTime()
public void setData(Data data)
data
- featurespublic Data getData()
public float getScore()
public float calculateScore(Data feature)
calculateScore
in interface Scoreable
feature
- the feature to be scoredpublic float[] calculateComponentScore(Data feature)
public float normalizeScore(float maxLogScore)
normalizeScore
in interface Scoreable
maxLogScore
- the score to normalize this score withpublic void setScore(float logScore)
logScore
- the new score for the token (in logMath log base)public float getLanguageScore()
public float getInsertionScore()
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 wordpublic java.lang.String getWordPathNoFiller()
public java.lang.String getWordPath()
public java.lang.String getWordUnitPath()
public Word getWord()
public static void showCount()
public boolean validate()
protected static java.text.DecimalFormat getScoreFormat()
protected static java.text.DecimalFormat getNumberFormat()
public void update(Token predecessor, SearchState nextState, float logEntryScore, float insertionProbability, float languageProbability, long collectTime)