Simulating grammar recognition

Last reviewed: 11/19/2007

HOW Article ID: H110701

The information in this article applies to:

  • GrammarKit 2, 3
  • GrammarKit 5, 6


You can now compile and test grammar rules with simulated recognition by having the recognizer match against a text string.

Within Chant Developer Workbench 2007, you can use GrammarKit 2 to open and compile grammars for SAPI 4, SAPI 5, IBM ViaVoice, and VoCon 3200. With SpeechKit 5, you can activate these grammars and test them to verify your rules are matching with live or recording audio. With SAPI 5 Grammars, you can simulate grammar recognition and test your grammar rules with text strings.

More Information

A grammar compiler transforms a speech recognition grammar into a binary format usable by speech recognition engines.

Chant GrammarKit provides a way for you to compile and test a grammar without having to write any software. When you compile a grammar, you are validating the grammar syntax and attribute values. To test the grammar it must be compiled, loaded, and activated.

Chant GrammarKit

To open an existing grammar for editing with Chant GrammarKit, select the F ile - Open menu item or click the Open Standard toolbar button and select the grammar file type to launch the open file dialog. Note if you do not see any grammar file types listed in the menu, then you need to run the Chant Software Unlock utility to begin your evaluation, your GrammarKit evaluation has expired, or you need to register and unlock your licensed copy with a serial number.

To compile a grammar, select the Speech - Compile Grammar menu item or click the Compile Grammar Speech toolbar button. Compilation messages are displayed in the Output window.

To test the grammar, you must compile, load, and activate it. You may do this in one step by selecting the Speech - Activate Grammar menu item or by clicking the Activate Grammar Speech toolbar button. You may say the various combinations of phrases supported by the rule(s). The recognition results are displayed in the Events window.

To test the grammar with a wave file, enter StartRecording $File in the command window and press the Enter key. You are prompted to select a file.

    >StartRecording $File

To test a SAPI 5 grammar with simulated recognition, enter StartRecording followed by the rule value to test in the command window and press the Enter key.

    >StartRecording hello world

When you are finished testing the grammar, you may deactivate it by selecting the Speech - Deactivate Grammar menu item or by clicking the Deactivate Grammar Speech toolbar button.