Tags

Tags are special tokens in a grammar that are automatically recognized whenever they are seen by the Speech Engine.  They are usually filled with information useful to the author of the grammar, or to an application using a grammar.  Tags may appear in the header or the body of a grammar.  When the engine recognizes a rule containing a tag, it returns the tag information along with the rule.

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
more text
<rule>



Was this article helpful?
Copyright (C) 2001-2024, Ai Software, LLC d/b/a LumenVox