Share via


GrammarBuilder.Append Method (String, SubsetMatchingMode)

Appends an instance of GrammarBuilder to the current GrammarBuilder.

Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)

Syntax

'Declaration
Public Sub Append ( _
    phrase As String, _
    subsetMatchingCriteria As SubsetMatchingMode _
)
public void Append (
    string phrase,
    SubsetMatchingMode subsetMatchingCriteria
)
public:
void Append (
    String^ phrase, 
    SubsetMatchingMode subsetMatchingCriteria
)
public void Append (
    String phrase, 
    SubsetMatchingMode subsetMatchingCriteria
)
public function Append (
    phrase : String, 
    subsetMatchingCriteria : SubsetMatchingMode
)

Parameters

  • phrase
    A System.String containing a phrase to be used recognized.
  • subsetMatchingCriteria
    A member of SubsetMatchingMode defining the method used to match audio input which may be a subset of the match string

Remarks

The logic of each element appended to a GrammarBuilder is applied by recognition engines in the order in which it was appended.

The logic of each element appended to a GrammarBuilder is applied by recognition engines in the order in which it was appended.

For detailed information on the use of sub set matching modes, see Microsoft.Speech.Recognition.SubsetMatchingMode.

Example

Below is a test routine which generates four Grammar, one for each mode with the same string. These Grammar objects can then be tested.

private void CreateSubsetMatchTest() {
    foreach ( Microsoft.Speech.Recognition.SubsetMatchingMode mode 
              in Enum.GetValues(typeof(Microsoft.Speech.Recognition.SubsetMatchingMode))){

    GrammarBuilder gb = new GrammarBuilder();
    gb.Append("a car the truck a boat that plane",mode);
    Grammar grammar = new Grammar(gb);
    grammar.Name = mode.ToString();
    grammar.Enabled=true;
        _recognizer.LoadGrammar(grammar);
    }

}

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

GrammarBuilder Class
GrammarBuilder Members
Microsoft.Speech.Recognition Namespace