Last reviewed: 3/23/2024 8:35:47 AM
<RULE>
A <RULE> element defines a phrase to recognize. A <RULE> definition may consist of a single <PHRASE> or multiple generations of grammar elements depending on the complexity of what can be spoken.
<GRAMMAR LANGID="409">
<RULE NAME="sandwiches" TOPLEVEL="ACTIVE">
<OPT><RULEREF NAME="number"/></OPT>
<LIST PROPNAME="menuitems">
<PHRASE>VALUE MEAL</PHRASE>
<PHRASE>KIDS MEAL</PHRASE>
<PHRASE>FISH FILET DELUXE</PHRASE>
<PHRASE>JUMBO BURGER DELUXE</PHRASE>
<PHRASE>CHICKEN FILET DELUXE</PHRASE>
<PHRASE>APPLE PIE</PHRASE>
<PHRASE>COOKIES</PHRASE>
</LIST>
</RULE>
<RULE NAME="number">
<LIST PROPNAME="number">
<PHRASE VALSTR="1">one</PHRASE>
<PHRASE VALSTR="2">two</PHRASE>
<PHRASE VALSTR="3">three</PHRASE>
<PHRASE VALSTR="4">four</PHRASE>
<PHRASE VALSTR="5">five</PHRASE>
<PHRASE VALSTR="6">six</PHRASE>
<PHRASE VALSTR="7">seven</PHRASE>
<PHRASE VALSTR="8">eight</PHRASE>
<PHRASE VALSTR="9">nine</PHRASE>
<PHRASE VALSTR="10">ten</PHRASE>
</LIST>
</RULE>
</GRAMMAR>
Attributes
DYNAMIC
Indicates whether the rule can be updated (dynamically) at runtime. Valid values include: 0 or 1, False or True, and No or Yes. The default value is 0. This attribute is optional.
EXPORT
Indicates whether the rule can be loaded by another grammar. By default, all grammars are not exportable. Dynamic rules or rules that reference dynamic rules cannot be exported. Valid values include: 0 or 1, False or True, and No or Yes. The default value is 0. This attribute is optional.
ID
A numeric identifier that is associated with a rule. This attribute is optional.
INTERPRETER
Indicates whether the rule should use the CFG-interpreter. Valid values include: Valid values include: 0 or 1, False or True, and No or Yes. The default value is 0. This attribute is optional.
NAME
A string identifier that is associated with a rule. This attribute is optional.
TOPLEVEL
Indicates that the rule is not dependent on parent rule and may be activated and deactivated programmatically. Valid values include ACTIVE and INACTIVE that specifies whether the rule is active by default when the grammar is loaded. The default value is INACTIVE. This attribute is optional.
Children
<DICTATION>, <LIST>, <OPT>, <PHRASE>, <RESOURCE>, <RULEREF>, <TEXTBUFFER>, and <WILDCARD>.