Modules | Files | Inheritance Tree | Inheritance Graph | Name Index
module GNOME::Speech::Recognition
interface FinalDictationResult
Files: GNOME_Speech.idl
GNOME-Speech-Recognition-FinalDictationResult-inheritance GNOME-Speech-Recognition-FinalResult.html GNOME-Speech-Recognition-Result.html GNOME-Speech-SpeechObject.html Bonobo-Unknown.html
Operations Summary:
ResultTokenArray2DgetAlternativeTokens(in ResultToken fromToken, in ResultToken toToken, in long max) raises

Operations Inherited from FinalResult
getAudio, getAudioForToken, isAudioAvailable, releaseAudio, isTrainingInfoAvailable, releaseTrainingInfo, tokenCorrection

Operations Inherited from Result
addResultListener, removeResultListener, getBestToken, getBestTokens, getGrammar, getResultState, getUnfinalizedTokens, numTokens

Operations Inherited from Bonobo::Unknown
ref, unref, queryInterface

Operation Details:
ResultTokenArray2D getAlternativeTokens(in ResultToken fromToken, in ResultToken toToken, in long max) raises (IllegalArgumentException, ResultStateError)

Return a set of alternative token guesses for a single known token or sequence of tokens. In a dictation application the alternative guesses are typically provided to a user to facilitate efficient correction of dictated text. The assumption is that if a recognizer does not correctly hear a user (a mis-recognition) the correct tokens are likely to be amongst the top alternatives guesses.

Typically when a user selects one of the alternative guesses as the correct token sequence, the tokenCorrection method of the FinalResult interface is called with those tokens. That call allows the Recognizer to learn from recognition errors and can improve future recognition accuarcy.

The fromToken and toToken parameters define an inclusive set of tokens for which alternatives are required. fromToken and toToken are typically included in the set of alternative guesses. If toToken is null or if fromToken and toToken are the same, then alternatives are provided for the single toToken token.

The tokens passed to this method must be ResultToken objects provided by this result through previous calls to getAlternativeTokens or the getBestToken and getBestTokens methods of the Result interface.

Returned Array Structure

The return value is a ragged two-dimension array with indices being altTokens[guessNumber][tokenNumber]. The guesses are ordered by from best guess to least likely (determined by the recognizer): altTokens[0] is the best guess for the span of fromToken to toToken, altTokens[1] is the first alternative guess and so on.

The number of tokens may be different in each alternative guess. This means that the length of altTokens[0] may be different from the length of altTokens[1] and so on. The length is never zero or less. (This point is illustrated in the example below.)

The max parameter indicates the maximum number of alternative guesses to be returned. The number of guesses returned may be less than or equal to max. The number of alternatives returned is also less than or equal to the NumResultAlternatives property set in the RecognizerProperties at the time of recognition.

The number of alternative guesses and the number of tokens in each guess can vary between results. The numbers can vary for different values of fromToken and toToken for the calls to the same result.

The returned alternative guess is always an array of length one or greater. If there is only one guess, it may be the sequence of fromToken to toToken tokens. Each guess always contains one or more tokens. If the result is ACCEPTED then the recognizer is confident that all the alternatives guesses are reasonable guesses of what the user said.

Return:
a set of alternative token guesses for a single known token or sequence of tokens.
See Also:
Result
Result#numTokens
Result#getBestToken
Result#getBestTokens
FinalResult#tokenCorrection
RecognizerProperties#setNumResultAlternatives