saiAddRecognitionGrammar

Adds a grammar definition to the grammar set. The definition is used when defining a grammar and starting a recognizer.

Prototype

DWORD saiAddRecognitionGrammar ( void *gramlist, SAI_GRAMMAR_TYPE gramtype, char *gramname, char *grammar )

Argument

Description

gramlist

Pointer to a grammar list to which to add the grammar definition.

gramtype

Grammar type of the recognition grammar definition (URL or XML).

gramname

Pointer to a grammar name associated with the grammar entry.

grammar

Pointer to a new added grammar of type SAI_GRAMMAR.


Return values

Return value

Description

SUCCESS

 

SAIERR_INVALID_PARAMETER

One of the specified arguments is invalid.

SAIERR_LIST_NOT_INITIALIZED

Grammar list referenced by gramlist was not initialized with saiInitRecognitionList.

SAIERR_NOT_ENOUGH_MEMORY

Grammar container referenced by gramlist does not have enough space for the new grammar.


Details

Before calling saiAddRecognitionGrammar, applications must call saiDefineGrammarRecognizer. For more information, refer to Creating a recognition grammar.

Example

See saiStartRecognizer.