|
|||||||||
| 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 | |
|---|---|
private static int |
curCount
|
private int |
frameNumber
|
private static int |
lastCount
|
private int |
location
|
private float |
logAcousticScore
|
private float |
logInsertionScore
|
private float |
logLanguageScore
|
private float |
logTotalScore
|
private float |
logWorkingScore
|
private Data |
myData
|
private static java.text.DecimalFormat |
numFmt
|
private Token |
predecessor
|
private static java.text.DecimalFormat |
scoreFmt
|
private SearchState |
searchState
|
private java.util.HashMap<java.lang.String,java.lang.Object> |
tokenProps
A collection of arbitrary properties assigned to this token. |
| Fields inherited from interface edu.cmu.sphinx.decoder.scorer.Scoreable |
|---|
COMPARATOR |
| Constructor Summary | |
|---|---|
Token(SearchState state,
int frameNumber)
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,
int frameNumber)
Internal constructor for a token. |
|
| Method Summary | |
|---|---|
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). |
Data |
getData()
Returns the feature for this Token. |
int |
getFrameNumber()
Returns the frame number for this token. |
float |
getInsertionScore()
Returns the insertion score 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. |
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 |
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. |
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static int curCount
private static int lastCount
private static final java.text.DecimalFormat scoreFmt
private static final java.text.DecimalFormat numFmt
private final Token predecessor
private final float logLanguageScore
private float logTotalScore
private float logInsertionScore
private float logAcousticScore
private float logWorkingScore
private final SearchState searchState
private int location
private final int frameNumber
private Data myData
private java.util.HashMap<java.lang.String,java.lang.Object> tokenProps
| Constructor Detail |
|---|
public Token(Token predecessor,
SearchState state,
float logTotalScore,
float logInsertionScore,
float logLanguageScore,
int frameNumber)
predecessor - the predecessor for this tokenstate - 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)frameNumber - the frame number associated with this token
public Token(SearchState state,
int frameNumber)
state - the SearchState associated with this tokenframeNumber - the frame number for this token
public Token(Token predecessor,
float logTotalScore,
float logAcousticScore,
float logInsertionScore,
float logLanguageScore)
logAcousticScore - the log acoustic scorelogLanguageScore - the log language scorepredecessor - the predecessor Token| Method Detail |
|---|
public Token getPredecessor()
public int getFrameNumber()
getFrameNumber in interface Scoreablepublic void setData(Data data)
data - public Data getData()
public float getScore()
getScore in interface Scoreablepublic float calculateScore(Data feature)
calculateScore in interface Scoreablefeature - the feature to be scored
public float normalizeScore(float maxLogScore)
normalizeScore in interface ScoreablemaxLogScore - 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 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.Objectpublic void dumpTokenPath()
public void dumpTokenPath(boolean includeHMMStates)
includeHMMStates - if true include all sentence hmm states
public 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()
protected static java.text.DecimalFormat getScoreFormat()
protected static java.text.DecimalFormat getNumberFormat()
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 | ||||||||