次の方法で共有


ISpRecoGrammar (Windows Embedded CE 6.0)

1/6/2010

This interface enables applications to manage the words and phrases that the SR engine will recognize. It inherits from ISpGrammarBuilder.

Each object implementing ISpRecoGrammar can have a context-free grammar (CFG) and a dictation grammar loaded simultaneously (for example, using the CFG if possible, but returning to dictation if the CFG fails to parse). A single recognizer object implementing ISpRecognizer can have multiple speech recognition context objects (ISpRecoContext) associated with it. Similarly, a single context object can be associated with multiple objects implementing ISpRecoGrammar. This one-to-many relationship allows applications to separate types of recognizable phrases and content into separate objects for clearer application logic.

Methods

The following table lists methods for the ISpRecoGrammar interface.

Methods Description

GetGrammarId

Gets the grammar identifier associated with the application.

GetGrammarState

Gets recognition grammar state information.

GetRecoContext

Gets the context object that created the grammar.

IsPronounceable

Determines if a word has a pronunciation.

LoadCmdFromFile

Loads a command and control grammar from a file.

LoadCmdFromMemory

Loads a command and control grammar from memory.

LoadCmdFromProprietaryGrammar

Loads an engine proprietary format command and control grammar.

LoadCmdFromResource

Loads a command and control grammar from a Win32 resource.

LoadDictation

Loads and initializes a dictation topic.

SaveCmd

Allows applications using dynamic grammars to save the current grammar state to a stream.

SetDictationState

Sets a dictation state to active or inactive.

SetGrammarState

Sets the state of a grammar. Changing the state affects the state of all the active rules in the grammar.

SetRuleIdState

Activates or deactivates a rule by its rule identifier.

SetRuleState

Activates or deactivates a rule by its rule name.

SetTextSelection

Sets the insertion point (using word sequence data buffer).

SetWordSequenceData

Sets word sequence data.

UnloadDictation

Unloads the active dictation topic from the grammar.

Requirements

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

SAPI Interfaces