Last reviewed: 3/23/2024 8:04:26 AM

Designing Grammars with GrammarKit

A grammar consists of one or more rules that define words and phrases for which to listen. Grammars are defined in text files, compiled into binary, and then loaded by the recognizer to use for matching against utterances.

Chant GrammarKit handles the complexities of constructing, compiling, and persisting the compiled grammar binary. This allows you to distribute compiled grammar binary files with your application, generate and compile grammars as part of your deployed application, and optimize grammar enablement at runtime by using compiled binary files.

Recognizers have their own syntax for expressing grammars. GrammarKit supports the following speech application program interfaces (APIs) and grammar syntax:

Speech API Grammar Syntax
Microsoft SAPI 5SAPI 5 XML Grammar
W3C SRGS XML
Microsoft Speech PlatformW3C SRGS XML
Microsoft .NET System.SpeechW3C SRGS XML
Microsoft .NET Microsoft.SpeechW3C SRGS XML
Microsoft WindowsMedia (UWP and WinRT)W3C SRGS XML

For more information about the designing grammars with GrammarKit, review the following topics: