7   Grammar Compiler

The Grammar Compiler lets you submit a grammar source and have it compiled offline prior to executing a VoiceXML application. The application can then refer to the compiled grammar by using a special key provided after compilation. Currently, the Grammar Compiler supports Nuance GSL grammars. Currently the tool supports English and Spanish languages. Valid values for the language field are en-us and es-us.

Compiling grammars before execution is especially useful with large grammars where the compilation overhead during execution of your VoiceXML application could cause significant delays.

Grammar files larger than 200 kilobytes must be compiled (either using the Grammar Compilation tool or with the Grammar Compilation SOAP service), because applications are not allowed to reference that large a source grammar file. (This size restriction also applies to hosting customers.)

Typically, you develop and test your application to reference a small subset of your grammar in a source grammar file. When you are ready to test or deploy the application with the full grammar, you compile the full grammar file and modify your application to reference the compiled file.

Note: To use the BeVocal tools, you must have the Java Runtime Environment (JRE) 1.5.7 installed on your computer.

Compiling a Grammar

To compile a grammar,

1. Click Grammar Compiler on the Tools & File Management menu to bring up the Grammar Compiler window. The command portion of this window initially appears as follows:

2. In the Grammar URL text box, enter the location of the grammar, for example:
 
http://www.mycompany.com/vxml/grammars/colors.grammar
  To specify the root rule of the grammar, add it to the URL, for example:
 
http://www.mycompany.com/vxml/grammars/colors.grammar#Colors
  If you do not specify a root rule, the compiler uses the first rule in the grammar as the root rule. For more information on grammars, see the Grammar Reference.
3. In the E-mail text box, enter and email address where you can be notified when the compilation is complete.
4. In the Language text box, enter one of the valid languages. The default is "en-us". Currently, only English ("en-us"), Spanish ("es-us"), and French Canadian ("fr-ca") are supported. If an unsupported language is entered, the default is used.
5. Click Compile.

When the system completes the compilation, it sends and email notification to the address you supplied. The email includes a unique key you use to refer to the grammar.

Using a Compiled Grammar

To reference the grammar in a compiled grammar file, you set the src attribute of the <grammar> element to a URI that includes the key:

 <grammar ... src="compiled:grammar/key" ...>

where key is the unique key for the compiled file that you received by email.

The root rule of the grammar will be what you specified when you compiled the grammar.


[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0005-01 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL