GrammarBuilder.Addition Operator (Choices, GrammarBuilder)


Creates a new GrammarBuilder that contains a Choices object followed by a GrammarBuilder object.

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

public static GrammarBuilder operator +(
	Choices choices,
	GrammarBuilder builder


Type: System.Speech.Recognition.Choices

The first grammar element, which represents a set of alternatives.

Type: System.Speech.Recognition.GrammarBuilder

The second grammar element.

Return Value

Type: System.Speech.Recognition.GrammarBuilder

Returns a GrammarBuilder for the sequence of the choices parameter followed by the builder parameter.

GrammarBuilder supports conversions from the following classes.

This method accepts the objects listed above for the builder parameter. For more information, see the Implicit operators.


When you combine Choices and GrammarBuilder objects that contain SemanticResultValue or SemanticResultKey instances, make sure you avoid creating duplicate semantic elements with the same key name or multiple semantic elements that could repeatedly modify the Value property of a SemanticValue object. The speech recognizer can throw an exception if it encounters these circumstances. For more information about building a speech recognition grammar that contains semantic information, see Understanding SemanticResultValue and SemanticResultKey Objects.

.NET Framework
Available since 3.0
Return to top