SrgsRule Class

Microsoft Speech Platform SDK 11

Collapse image Expand Image Copy image CopyHover image

Represents a grammar rule.

Inheritance Hierarchy

System..::..Object
  Microsoft.Speech.Recognition.SrgsGrammar..::..SrgsRule

Namespace:  Microsoft.Speech.Recognition.SrgsGrammar
Assembly:  Microsoft.Speech (in Microsoft.Speech.dll)

Syntax

Visual Basic (Declaration)
<SerializableAttribute> _
Public NotInheritable Class SrgsRule
Visual Basic (Usage)
Dim instance As SrgsRule
C#
[SerializableAttribute]
public sealed class SrgsRule

Remarks

Use the SrgsRule class to create a new rule at run time or to modify a rule in an existing grammar stream or file at run time.

The words and phrases specified by SrgsRule objects in grammars defined by SrgsDocument instances limit the spoken input that the recognizer must be able to identify.

An SrgsRule object specifies the sequence in which words and phrases must be spoken by ordering the objects that contain them. Words and phrases within a rule are represented by objects such as SrgsItem, SrgsOneOf, SrgsRuleRef, and SrgsToken elements. Use the Elements property to access the collection of child objects that an SrgsRule object contains.

You can determine whether an SrgsRule can be specified in a rule reference from a rule in an external grammar by setting its Scope property.

It is not legal to define an SrgsRule that is empty or that contains only white space.

This class represents the rule element that is defined in the World Wide Web Consortium (W3C) Speech Recognition Grammar Specification (SRGS) Version 1.0. For information about the SRGS rule element and details about its support by the Microsoft Speech Platform SDK 11, see rule Element (Microsoft.Speech).

Thread Safety

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

See Also