Grammar Constructor

 

Initializes a new instance of the Grammar class.

Namespace:   System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)

NameDescription
System_CAPS_protmethodGrammar()

Initializes a new instance of the Grammar class

System_CAPS_pubmethodGrammar(GrammarBuilder)

Initializes a new instance of the Grammar class from a GrammarBuilder object.

System_CAPS_pubmethodGrammar(SrgsDocument)

Initializes a new instance of a Grammar class from an SrgsDocument object.

System_CAPS_pubmethodGrammar(SrgsDocument, String)

Initializes a new instance of a Grammar class from an SrgsDocument object and specifies a root rule.

System_CAPS_pubmethodGrammar(SrgsDocument, String, Object[])

Initializes a new instance of the Grammar class from an instance of SrgsDocument, and specifies the name of a rule to be the entry point to the grammar.

System_CAPS_pubmethodGrammar(SrgsDocument, String, Uri)

Initializes a new instance of a Grammar class from an SrgsDocument object, specifies a root rule, and defines a base Uniform Resource Identifier (URI) to resolve relative rule references.

System_CAPS_pubmethodGrammar(SrgsDocument, String, Uri, Object[])

Initializes a new instance of the Grammar class from an instance of SrgsDocument, and specifies the name of a rule to be the entry point to the grammar and a base URI to resolve relative references.

System_CAPS_pubmethodGrammar(Stream)

Initializes a new instance of the Grammar class from a Stream.

System_CAPS_pubmethodGrammar(Stream, String)

Initializes a new instance of the Grammar class from a Stream and specifies a root rule.

System_CAPS_pubmethodGrammar(Stream, String, Object[])

Initializes a new instance of the Grammar class from a Stream and specifies a root rule.

System_CAPS_pubmethodGrammar(Stream, String, Uri)

Initializes a new instance of the Grammar class from a stream, specifies a root rule, and defines a base Uniform Resource Identifier (URI) to resolve relative rule references.

System_CAPS_pubmethodGrammar(Stream, String, Uri, Object[])

Initializes a new instance of the Grammar class a Streamand specifies a root rule and a base URI to resolve relative references.

System_CAPS_pubmethodGrammar(String)

Initializes a new instance of the Grammar class from a file.

System_CAPS_pubmethodGrammar(String, String)

Initializes a new instance of the Grammar class from a file and specifies a root rule.

System_CAPS_pubmethodGrammar(String, String, Object[])

Initializes a new instance of the Grammar class from a file that contains a grammar definition, and specifies the name of a rule to be the entry point to the grammar..

You can use a Grammar constructor to create a Grammar instance from a GrammarBuilder or SrgsDocument object, or from a file or a Stream that contains a description of a grammar in a supported format. Supported formats include the following:

Grammar constructors that accept XML-format grammar files in their arguments compile the XML grammars to a binary format to optimize them for loading and consumption by a speech recognition engine. You can reduce the amount of time required to construct a Grammar object from an XML-format grammar by compiling the grammar in advance, using one of the Compile methods.

A speech recognition grammar can define a root rule. To create a Grammar object that specifies which rule to use as its root rule, use a constructor that accepts the ruleName parameter.

To create a Grammar object that specifies a base URI to resolve relative rule references, use a constructor that takes the baseUri parameter.

Return to top
Show: