Bagikan melalui


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Grammar Members

Include Protected Members
Include Inherited Members

A run-time object that references a speech recognition grammar, which an application can use to define the constraints for speech recognition.

The Grammar type exposes the following members.

Constructors

  Name Description
Public method Grammar(Stream) Initializes a new instance of the Grammar class from a Stream.
Public method Grammar(String) Initializes a new instance of the Grammar class from a file.
Public method Grammar(GrammarBuilder) Initializes a new instance of the Grammar class from a GrammarBuilder object.
Public method Grammar(GrammarInfo) Creates a new instance of the Grammar class from a GrammarInfo instance.
Public method Grammar(SrgsDocument) Initializes a new instance of the Grammar class from an SrgsDocument object.
Public method Grammar(Stream, String) Initializes a new instance of the Grammar class from a Stream and specifies a root rule.
Public method Grammar(String, String) Initializes a new instance of the Grammar class from a file and specifies a root rule.
Public method Grammar(SrgsDocument, String) Initializes a new instance of a Grammar class from an SrgsDocument object and specifies a root rule.
Public method Grammar(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.
Public method Grammar(String, String, Uri) Initializes a new instance of the Grammar class from a file, specifies a root rule, and defines a base Uniform Resource Identifier (URI) to resolve relative rule references.
Public method Grammar(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.

Top

Properties

  Name Description
Public property Enabled Gets or sets a value that controls whether a Grammar can be used by a recognition engine to perform recognition.
Public property Loaded Gets whether a Grammar has been loaded by a recognition engine.
Public property Name Gets or sets the name of a Grammar object.
Public property Priority Gets or sets the priority value of a Grammar object.
Public property RuleName Gets the identifier of the root rule or entry point rule of a Grammar instance.
Public property Weight Gets or sets the weight value of a Grammar object.

Top

Methods

  Name Description
Public method Equals (inherited from Object)
Protected method Finalize (inherited from Object)
Public method GetHashCode (inherited from Object)
Public method GetType (inherited from Object)
Public method IsPronounceable Gets whether the SpeechRecognitionEngine can pronounce the word and where the word's pronunciation is defined.
Protected method MemberwiseClone (inherited from Object)
Public method ToString (inherited from Object)

Top

Events

  Name Description
Public event SpeechRecognized Raised when a SpeechRecognitionEngine instance performs recognition using the Grammar object.

Top

See Also

Reference

Grammar Class

Microsoft.Speech.Recognition Namespace