no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | developer_guide:voicexml_references:elements:grammar [2015/10/27 12:38] (current) – created borja | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== < grammar > ====== | ||
+ | ===== Description ===== | ||
+ | |||
+ | The < grammar > element specifies a grammar (word or phrase) for speech recognition. | ||
+ | |||
+ | NOTE: | ||
+ | |||
+ | Inline grammars that use the XML grammar format will be passed into the Speech Recognition Engine as an XML document. | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | xml: | ||
+ | src=" | ||
+ | scope=" | ||
+ | type=" | ||
+ | mode=" | ||
+ | root=" | ||
+ | version=" | ||
+ | weight=" | ||
+ | fetchhint=" | ||
+ | fetchtimeout=" | ||
+ | maxage=" | ||
+ | maxstale=" | ||
+ | inline grammar | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Attributes ===== | ||
+ | |||
+ | |xml: | ||
+ | |src|The src attribute is the URI of the grammar specification. The URI can have one of the following formats: \\ * External grammar file – the URI of the grammar file. \\ * Built-in grammars – the builtin: | ||
+ | |scope|The scope attribute defines the scope of the grammar. | ||
+ | |type|The type attribute defines the MIME type of grammar format. \\ The following types are supported: \\ * application/ | ||
+ | |mode|The mode attribute defines the mode of the grammar. | ||
+ | |root|The root attribute specifies the root rule of the grammar when this is an inline XML grammar. | ||
+ | |version|The version attribute defines the version of the grammar. | ||
+ | |weight|The weight attribute defines the weight of a grammar, which indicates the possible occurrence of the grammar which can potentially increase recognition accuracy. | ||
+ | |fetchtimeout|The fetchtimeout attribute is the time interval to wait for an grammar file to be fetched. This attribute is optional.| | ||
+ | |fetchhint|The fetchhint attribute defines when the grammar file should be retrieved. This attribute is optional. \\ * prefetch – the audio file may be downloaded when the page is loaded. \\ * safe – the audio file only loads when needed.| | ||
+ | |maxage|The maxage attribute indicates the maximum time in seconds that this document will use the grammar file before fetching another copy. This attribute is optional.| | ||
+ | |maxstale|The maxstale attribute indicates the maximum time in seconds that this document will use a grammar file that exceeded the maxage time. This attribute is optional.| | ||
+ | |||
+ | ===== Parents ===== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ===== Children ===== | ||
+ | |||
+ | < | ||
+ | None. | ||
+ | </ | ||
+ | |||
+ | ===== Extensions ===== | ||
+ | |||
+ | < | ||
+ | None. | ||
+ | </ | ||
+ | |||
+ | ===== Limitations/ | ||
+ | |||
+ | < | ||
+ | None. | ||
+ | </ | ||
+ | |||
+ | ===== Example Code ===== | ||
+ | |||
+ | < | ||
+ | <?xml version=" | ||
+ | <vxml version=" | ||
+ | < | ||
+ | <field name=" | ||
+ | < | ||
+ | Enter a number | ||
+ | </ | ||
+ | < | ||
+ | 1 {uno} | | ||
+ | 2 {dos} | | ||
+ | 3 {tres} | | ||
+ | 4 {cuatro} | | ||
+ | 5 {cinco} | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | in Spanish is | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ |