|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResultToken
A token (usually a word) contained by a Result
representing something
heard by a Recognizer
.
For a Result
from a RuleGrammar
, a ResultToken
contains the same String
as the defining RuleToken
in the RuleGrammar
.
For any Result
, best finalized ResultToken
s are
obtained from the getBestToken
and getBestTokens
methods
of the Result
interface.
For a finalized Result
, alternatives may be available through
the getAlternativeTokens
method of the FinalResult
interface.
The ResultToken
provides the following information:
Result
that contains
this ResultToken
Result
,
getBestToken
,
getBestTokens
,
FinalResult
,
getAlternativeTokens
Method Summary | |
---|---|
int |
getConfidenceLevel()
Gets the confidence level of this token. |
long |
getEndTime()
Gets the approximate end time for this token in milliseconds. |
Result |
getResult()
Returns a reference to the result that contains this token. |
long |
getStartTime()
Gets the approximate start time for this token in milliseconds. |
String |
getText()
Gets the text of this token. |
Method Detail |
---|
int getConfidenceLevel()
MIN_CONFIDENCE
and MAX_CONFIDENCE
.
Not all Engine
s support confidence levels for tokens.
Confidence levels may only be available in the ACCEPTED
state.
A value of UNKNOWN_CONFIDENCE
may be returned if the confidence
is unavailable or not supported
RecognizerProperties
,
setConfidenceThreshold
,
MIN_CONFIDENCE
,
MAX_CONFIDENCE
,
UNKNOWN_CONFIDENCE
,
getResultState
,
ACCEPTED
long getEndTime()
The end time of a token is always less than or equal to the start time of a succeeding token. The values will be different if the tokens are separated by a pause.
Returns UNKNOWN_AUDIO_POSITION
if timing information is not available.
Not all recognizers provide timing information.
Timing information is not usually available for unfinalized
or finalized tokens in a Result that is not yet finalized.
Even if timing information is available for tokens in the best result,
it might not be available for tokens in other alternatives.
UNKNOWN_AUDIO_POSITION
if not available.currentTimeMillis
,
getStartTime
,
UNKNOWN_AUDIO_POSITION
Result getResult()
String getText()
getText
,
getText
long getStartTime()
The start time of a token is always greater than or equal to the the end time of a preceding token. The values will be different if the tokens are separated by a pause.
Returns UNKNOWN_AUDIO_POSITION
if timing information is not available.
Not all recognizers provide timing information.
Timing information is not usually available for unfinalized or
finalized tokens in a Result that is not yet finalized.
Even if timing information is available for tokens in the best result,
it might not be available for tokens from other alternatives.
UNKNOWN_AUDIO_POSITION
if not availablecurrentTimeMillis
,
getEndTime
,
UNKNOWN_AUDIO_POSITION
|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API 2.0,
Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.