Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
GrammarBuilder.AppendRuleReference Method
Include Protected Members
Include Inherited Members
Appends a grammar file or a grammar rule to the current sequence of grammar elements.
Overload List
Name | Description | |
---|---|---|
AppendRuleReference(String) | Appends a grammar definition file to the current sequence of grammar elements. | |
AppendRuleReference(String, String) | Appends the specified rule of a grammar definition file to the current sequence of grammar elements. |
Top
Remarks
The AppendRuleReference methods can append a grammar file or a grammar rule from a file. These methods allow applications to make use of pre-deployed or publicly available grammar rules. The application must have read access to the location of specified grammar files.
These methods can read a speech recognition grammar from the following formats.
XML-format files that conform to the W3C Speech Recognition Grammar Specification (SRGS) Version 1.0
Binary files that conform to the Microsoft Speech Recognition Grammar Binary Format (.cfg file extension)
Compiling an XML-format SRGS grammar file to a binary grammar file with the .cfg extension can reduce the time consumed by searches for a match, especially if the grammar requires recognition of a large number of words and phrases. For information about compiling SRGS grammars to the CFG binary format, see SrgsGrammarCompiler.