Compartilhar via


Note

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

GrammarBuilder Members

Include Protected Members
Include Inherited Members

Provides a mechanism for programmatically building the constraints for a speech recognition grammar.

The GrammarBuilder type exposes the following members.

Constructors

  Name Description
Public method GrammarBuilder() Initializes a new, empty instance of the GrammarBuilder class.
Public method GrammarBuilder(String) Initializes a new instance of the GrammarBuilder class from a sequence of words.
Public method GrammarBuilder(Choices) Initializes a new instance of the GrammarBuilder class from a set of alternatives.
Public method GrammarBuilder(SemanticResultKey) Initializes a new instance of the GrammarBuilder class from a semantic key.
Public method GrammarBuilder(SemanticResultValue) Initializes a new instance of the GrammarBuilder class from a semantic value.
Public method GrammarBuilder(String, SubsetMatchingMode) Initializes a new instance of the GrammarBuilder class from a subset of a sequence of words.
Public method GrammarBuilder(String, Int32, Int32) Initializes a new instance of the GrammarBuilder class from the sequence of words in a String and specifies how many times the String can be repeated.
Public method GrammarBuilder(GrammarBuilder, Int32, Int32) Initializes a new instance of the GrammarBuilder class for a repeated element.

Top

Properties

  Name Description
Public property Culture Gets or sets the culture of the grammar.
Public property DebugShowPhrases Gets a string that shows the contents and structure of the grammar contained by the GrammarBuilder.

Top

Methods

  Name Description
Public methodStatic member Add(String, GrammarBuilder) Creates a new GrammarBuilder that contains a phrase followed by a GrammarBuilder object.
Public methodStatic member Add(Choices, GrammarBuilder) Creates a new GrammarBuilder that contains a Choices object followed by a GrammarBuilder object.
Public methodStatic member Add(GrammarBuilder, Choices) Creates a new GrammarBuilder that contains a GrammarBuilder object followed by a Choices object.
Public methodStatic member Add(GrammarBuilder, GrammarBuilder) Creates a new GrammarBuilder that contains a sequence of two GrammarBuilder objects.
Public methodStatic member Add(GrammarBuilder, String) Creates a new GrammarBuilder that contains a GrammarBuilder object followed by a phrase.
Public method Append(String) Appends a phrase to the current sequence of grammar elements.
Public method Append(Choices) Appends a set of alternatives to the current sequence of grammar elements.
Public method Append(GrammarBuilder) Appends a grammar element to the current sequence of grammar elements.
Public method Append(SemanticResultKey) Appends a semantic key to the current sequence of grammar elements.
Public method Append(SemanticResultValue) Appends a semantic value to the current sequence of grammar elements.
Public method Append(String, SubsetMatchingMode) Appends an element for a subset of a phrase to the current sequence of grammar elements.
Public method Append(String, Int32, Int32) Appends a repeated phrase to the current sequence of grammar elements.
Public method Append(GrammarBuilder, Int32, Int32) Appends a repeated grammar element to the current sequence of grammar elements.
Public method AppendDictation() Appends grammar logic to provide access the default, free-text, dictation grammar provided by the Microsoft Speech Platform SDK 11.
Public method AppendDictation(String) Appends grammar logic to provide access to a special-function dictation grammar specified by a string.
Public method AppendRuleReference(String) Appends a grammar definition file to the current sequence of grammar elements.
Public method AppendRuleReference(String, String) Appends the specified rule of a grammar definition file to the current sequence of grammar elements.
Public method AppendWildcard Appends a recognition grammar element that matches any input to the current sequence of grammar elements.
Public method Equals (inherited from Object)
Protected method Finalize (inherited from Object)
Public method GetHashCode (inherited from Object)
Public method GetType (inherited from Object)
Protected method MemberwiseClone (inherited from Object)
Public method ToString (inherited from Object)

Top

Operators

  Name Description
Public operatorStatic member Addition(String, GrammarBuilder) Creates a new GrammarBuilder that contains a phrase followed by a GrammarBuilder.
Public operatorStatic member Addition(Choices, GrammarBuilder) Creates a new GrammarBuilder that contains a Choices object followed by a GrammarBuilder object.
Public operatorStatic member Addition(GrammarBuilder, Choices) Creates a new GrammarBuilder that contains a GrammarBuilder followed by a Choices.
Public operatorStatic member Addition(GrammarBuilder, GrammarBuilder) Creates a new GrammarBuilder that contains a sequence of two GrammarBuilder objects.
Public operatorStatic member Addition(GrammarBuilder, String) Creates a new GrammarBuilder that contains a GrammarBuilder followed by a phrase.
Public operatorStatic member Implicit(String to GrammarBuilder) Implicitly converts a String object to an instance of GrammarBuilder.
Public operatorStatic member Implicit(Choices to GrammarBuilder) Converts a Choices object to a GrammarBuilder object.
Public operatorStatic member Implicit(SemanticResultKey to GrammarBuilder) Converts a SemanticResultKey object to a GrammarBuilder object.
Public operatorStatic member Implicit(SemanticResultValue to GrammarBuilder) Converts a SemanticResultValue object to a GrammarBuilder object.

Top

See Also

Reference

GrammarBuilder Class

Microsoft.Speech.Recognition Namespace