public class Result
extends java.lang.Object
The following methods are not yet defined but should be:
public Result getDAG(int compressionLevel);
Constructor and Description |
---|
Result(ActiveList activeList,
java.util.List<Token> resultList,
long collectTime,
boolean isFinal,
boolean wordTokenFirst,
boolean toCreateLattice)
Creates a result
|
Result(AlternateHypothesisManager alternateHypothesisManager,
ActiveList activeList,
java.util.List<Token> resultList,
long collectTime,
boolean isFinal,
boolean wordTokenFirst,
boolean toCreateLattice)
Creates a result
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Token> |
findPartialMatchingTokens(java.lang.String text)
Searches through the n-best list to find the the branch that matches the
beginning of the given string
|
Token |
findToken(java.lang.String text)
Searches through the n-best list to find the the branch that matches the
given string
|
ActiveList |
getActiveTokens()
Returns a list of active tokens for this result.
|
AlternateHypothesisManager |
getAlternateHypothesisManager()
Returns the AlternateHypothesisManager Used to construct a Lattice
|
Token |
getBestActiveParitalMatchingToken(java.lang.String text)
Returns the best scoring token that matches the beginning of the given
text.
|
Token |
getBestActiveToken()
Returns the best scoring token in the active set
|
java.lang.String |
getBestFinalResultNoFiller()
Returns the string of the best final result, removing any filler words.
|
Token |
getBestFinalToken()
Returns the best scoring final token in the result.
|
java.lang.String |
getBestPronunciationResult()
The method is used when the application wants the phonemes on the best
final path.
|
java.lang.String |
getBestResultNoFiller()
Returns the string of the best result, removing any filler words.
|
Token |
getBestToken()
Returns the best scoring token in the result.
|
long |
getCollectTime()
Returns the current frame number
|
java.util.List<Data> |
getDataFrames()
Gets the feature frames associated with this result
|
int |
getEndFrame()
Gets the ending frame number for the result.
|
FrameStatistics[] |
getFrameStatistics()
Returns detailed frame statistics for this result
|
LogMath |
getLogMath()
Returns the log math used for this Result.
|
java.lang.String |
getReferenceText()
Retrieves the reference text.
|
java.util.List<Token> |
getResultTokens()
Returns a list of result tokens for this result.
|
int |
getStartFrame()
Gets the starting frame number for the result.
|
java.util.List<WordResult> |
getTimedBestResult(boolean withFillers)
Returns the string of words (with timestamp) for this token.
|
boolean |
getWordTokenFirst()
Getter for wordTokenFirst flag
|
boolean |
isFinal()
Determines if the result is a final result.
|
void |
setReferenceText(java.lang.String ref)
Sets the reference text
|
boolean |
toCreateLattice()
Checks if it justified to build lattice for this result
|
java.lang.String |
toString()
Returns a string representation of this object
|
boolean |
validate()
Determines if the Result is valid.
|
public Result(AlternateHypothesisManager alternateHypothesisManager, ActiveList activeList, java.util.List<Token> resultList, long collectTime, boolean isFinal, boolean wordTokenFirst, boolean toCreateLattice)
alternateHypothesisManager
- hypothesis manageractiveList
- the active list associated with this resultresultList
- the result list associated with this resultcollectTime
- token time in a stream.isFinal
- if true, the result is a final resultwordTokenFirst
- if word token goes first.toCreateLattice
- create lattice or not.public Result(ActiveList activeList, java.util.List<Token> resultList, long collectTime, boolean isFinal, boolean wordTokenFirst, boolean toCreateLattice)
activeList
- the active list associated with this resultresultList
- the result list associated with this resultcollectTime
- token collect time in a stream.isFinal
- if true, the result is a final result. This means that the
last frame in the speech segment has been decoded.wordTokenFirst
- if word token goes first.toCreateLattice
- create lattice or not.public boolean isFinal()
SearchManager.recognize
calls.public boolean toCreateLattice()
public LogMath getLogMath()
public ActiveList getActiveTokens()
Token
objects that represents the leaf nodes of
all active branches in the result (sometimes referred to as the
'lattice').
The lattice is live and may be modified by a SearchManager during a
recognition. Once the Result is final, the lattice is fixed and will no
longer be modified by the SearchManager. Applications can modify the
lattice (to prepare for a re-recognition, for example) only after
isFinal
returns true
Token
public java.util.List<Token> getResultTokens()
Token
objects that represents the leaf nodes
of all final branches in the result (sometimes referred to as the
'lattice').
The lattice is live and may be modified by a SearchManager during a
recognition. Once the Result is final, the lattice is fixed and will no
longer be modified by the SearchManager. Applications can modify the
lattice (to prepare for a re-recognition, for example) only after
isFinal
returns true
Token
public AlternateHypothesisManager getAlternateHypothesisManager()
public long getCollectTime()
public Token getBestFinalToken()
public Token getBestToken()
public Token getBestActiveToken()
public Token findToken(java.lang.String text)
text
- the string to search forpublic java.util.List<Token> findPartialMatchingTokens(java.lang.String text)
text
- the string to search forpublic Token getBestActiveParitalMatchingToken(java.lang.String text)
text
- the text to matchpublic FrameStatistics[] getFrameStatistics()
null
if no frame statistics are
available.public int getStartFrame()
public int getEndFrame()
public java.util.List<Data> getDataFrames()
public java.lang.String getBestResultNoFiller()
public java.lang.String getBestFinalResultNoFiller()
public java.lang.String getBestPronunciationResult()
public java.util.List<WordResult> getTimedBestResult(boolean withFillers)
withFillers
- true if we want filler words included, false otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
public boolean validate()
public void setReferenceText(java.lang.String ref)
ref
- the reference textpublic java.lang.String getReferenceText()
public boolean getWordTokenFirst()