Modules | Files | Inheritance Tree | Inheritance Graph | Name Index
module GNOME::Speech::Recognition
interface ResultEvent
Files: GNOME_Speech.idl
GNOME-Speech-Recognition-ResultEvent-inheritance GNOME-Speech-SpeechEvent.html GNOME-Speech-SpeechObject.html Bonobo-Unknown.html
Operations Summary:
 voidinitWithResultAndId(in Result source, in long id)
 voidinitWithState(in Result source, in long id, in boolean isTokenFinalized, in boolean isUnfinalizedTokensChanged)
 booleanisTokenFinalized()
 booleanisUnfinalizedTokensChanged()

Operations Inherited from SpeechEvent
init, initWithId, getId, getSource, paramString, toString

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

Operation Details:
 void initWithResultAndId(in Result source, in long id)

Initializes a ResultEvent with an event type identifier. The isTokenFinalized and isUnfinalizedTokensChanged flags are set to false.

Parameters:
source - the object that issued the event.
id - the identifier for the event type.


 void initWithState(in Result source, in long id, in boolean isTokenFinalized, in boolean isUnfinalizedTokensChanged)

Initializes a ResultEvent for a specified source Result and result event id. The two boolean flags indicating change in tokens should be set appropriately for RESULT_CREATED, RESULT_UPDATED, RESULT_ACCEPTED and RESULT_REJECTED events. (For other event types these flags should be false).

Parameters:
source - the Result object that issued the event.
id - the identifier for the event type.
isTokenFinalized - true if any token is finalized with this event.
isUnfinalizedTokensChanged - true if the unfinalized text is changed with this event.
See Also:
RESULT_CREATED
GRAMMAR_FINALIZED
RESULT_UPDATED
RESULT_ACCEPTED
RESULT_REJECTED
AUDIO_RELEASED
TRAINING_INFO_RELEASED


 boolean isTokenFinalized()

For RESULT_CREATED, RESULT_UPDATED, RESULT_ACCEPTED and RESULT_REJECTED events returns true if any tokens were finalized. For other events, return false. If true, the number of tokens returned by numTokens and getBestTokens has increased.

Return:
an indication of whether this token is finalized.
See Also:
Result#numTokens
Result#getBestTokens


 boolean isUnfinalizedTokensChanged()

For RESULT_CREATED, RESULT_UPDATED, RESULT_ACCEPTED and RESULT_REJECTED events returns true if the unfinalized tokens changed. For other events, return false. If true, the value returned by getUnfinalizedTokens has changed.

Note that both RESULT_ACCEPTED and RESULT_REJECTED events implicitly set the unfinalized text to null. The isUnfinalizedTokensChanged method should return true only if the unfinalized text was non-null prior to finalization.

Return:
an indication on whether the unfinalized tokens changed.
See Also:
Result#getUnfinalizedTokens