New in VoiceXML 2.0. XML grammar element that specifies how to interpret the user input.
<tag>slotName="value" </tag>
This tag is used to define grammars in the XML form of the W3C Speech Recognition Grammar Format.
In general, a tag is an arbitrary string that may be included within any rule expansion. You can include as many tags as you want within a single expansion. Tags do not affect what constitutes a legal utterance for a rule nor do they affect how the recognition proceeds.
You use tags to return information--a semantic interpretation--about a recognition to the element that invoked the grammar. Upon successful recognition, the BeVocal VoiceXML interpreter will create a JavaScript object whose properties (slotname) and values (value) are determined by the tags occurring in the matched rule.
If you want the BeVocal VoiceXML interpreter to make use of your tags for this purpose, they must be of the format specified above.
See Chapter 1, "Using VoiceXML Grammars" in the Grammar Reference for information on how the interpreter will use the semantic interpretation.
| Parents | Children |
|
The following grammar sets two different tags:
<grammar ...>
<rule id="coloredObject">
<ruleref id="color"/>
<ruleref id="object"/>
</rule>
<rule id="color">
<one-of>
<item> red <tag> color="red" </tag> </item>
<item> pink <tag> color="red" </tag> </item>
<item> yellow <tag> color="yellow" </tag> </item>
<item> canary <tag> color="yellow" </tag> </item>
<item> green <tag> color="green" </tag> </item>
<item> khaki <tag> color="green" </tag> </item>
</one-of>
</rule>
<rule id="object">
<one-of>
<item>
<tag> object="vehicle" </tag>
<one-of>
<item>truck</item>
<item>car</item>
</one-of>
</item>
<item>
<tag> object="toy" </tag>
<one-of>
<item>ball</item>
<item>block</item>
</one-of>
</item>
<item>
<tag> object="clothing" </tag>
<one-of>
<item>shirt</item>
<item>blouse</item>
</one-of>
</item>
</one-of>
</rule>
</grammar>
This grammar recognizes phrases such as "green truck" or "khaki car". For both of those phrases, it will return the same semantic interpretation:
{
color: green;
object: vehicle;
}
| | Speech Recognition Grammar Specification: <tag> |
| | Chapter 1, "Using VoiceXML Grammars" and Chapter 4, XML Speech Grammar Format in the Grammar Reference |
| Café Home |
Developer Agreement |
Privacy Policy |
Site Map |
Terms & Conditions Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL |