Grammars

A grammar is an enumeration, in compact form, of the set of utterances—words and phrases—that constitute the acceptable user response to a given prompt. The VoiceXML Browser currently supports only Speech Recognition Grammar Specification (SRGS) XML format and ABNF form grammars.

See SRGS Version 1.0 at http://www.w3.org/TR/speech-grammar/ for more information. The limitations shown in Table 1 apply.

Table 1. Speech Recognition Grammar limitations in WebSphere Voice Server
Limitation Relevant section in specification
An exception is thrown if a grammar contains an external reference by URI. 2.2.2
The special rulename GARBAGE defaults to the rulename NULL. 2.2.3
An exception is thrown if a grammar contains a reference to an N-gram document. 2.2.4
Language declarations and attachments are ignored; the current speech recognition language is used. 2.7
References to external pronunciation lexicon documents are ignored. 4.10
<meta>and http-equiv declarations are ignored. 4.11

Grammars written in both SRGS XML format and ABNF also allow for the specification of semantic return values using the W3C Semantic Interpretation for Speech Recognition (SISR) 1.0 specification. For more information see http://www.w3.org/TR/semantic-interpretation/.

When you write your application, you can use the flexible, but generic, built-in grammars and create one or more of your own. Whether you use a built-in grammar or your own customized grammar, you must decide when each grammar should be active. The speech recognition engine uses only the active grammars to define what it listens for in the incoming speech. This section discusses the following topics: