Last reviewed: 3/23/2024 8:28:52 AM
<GRAMMAR>
A <GRAMMAR> element is the root element of a SAPI 5 context-free grammar. It defines the language of the grammar. A grammar file may contain only one <GRAMMAR> element.
<GRAMMAR LANGID="409" LEXDELIMITER="/" WORDTYPE="LEXICAL">
<RULE NAME="hello" TOPLEVEL="ACTIVE">
<PHRASE>Hello world</PHRASE>
</RULE>
</GRAMMAR>
Attributes
LANGID
Defines the language identifier of the XML grammar. The speech recognition engine must support the grammar's language identifier for the grammar to successfully be loaded. The default value is the current user's UI language. This attribute is optional.
LEXDELIMITER
Specifies the delimiter that SAPI should use to separate an explicit lexicon entry in the grammar. The format is: LEXDELIMITER DisplayForm LEXDELIMITER LexicalForm LEXDELIMITER Pronunciation;. The default value is "/". This attribute is optional.
WORDTYPE
Specifies the type of the word(s) to be added to the grammar. Value must be the string "LEXICAL" with SAPI 5.0 and SAPI 5.1. See SPGRAMMARWORDTYPE in the Microsoft Speech SDK 5.1 for more information. The default value is "LEXICAL". This attribute is optional.
Children
Parents
Grammar document.