Grammar Tags
Tags are special tokens in a grammar that the Speech Engine recognizes automatically wherever they appear. They carry information useful to the grammar author or to the application consuming the grammar, and they may appear in either the header or the body of a grammar. When the Engine matches a rule containing a tag, it returns the tagβs contents alongside the recognized rule β this is how a recognition result carries meaning back to the application, rather than just the matched words.
Filling tags with snippets of JavaScript is the basis of the semantic interpretation process.
ABNF
| // this is a header tag. // Its contents will be returned if the grammar is matched. {!{ tag information }!}; // this is a tag declared in a rule. $rule = some text {!{ tag information }!} more text; |
XML
| <!-- header tag. Its contents will be returned if the grammar is matched. --> <tag> tag information </tag> <rule id="rule"> some text <!-- a tag declared in a rule --> <tag> tag information </tag> more text </rule> |
