SrgsRule Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a grammar rule.
public ref class SrgsRule
public class SrgsRule
[System.Serializable]
public class SrgsRule
type SrgsRule = class
[<System.Serializable>]
type SrgsRule = class
Public Class SrgsRule
- Inheritance
-
SrgsRule
- Attributes
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 System.Speech, see rule Element.
Constructors
SrgsRule(String, SrgsElement[]) |
Initializes a new instance of the SrgsRule class from an array of SrgsElement objects. |
SrgsRule(String) |
Initializes a new instance of the SrgsRule class and specifies the identifier for the rule. |
Properties
BaseClass |
This property is not currently supported. |
Elements |
Gets the collection of SrgsElement objects in the SrgsRule instance. |
Id |
Gets or sets the identifier for the rule. |
OnError |
This property is not currently supported. |
OnInit |
This property is not currently supported. |
OnParse |
This property is not currently supported. |
OnRecognition |
This property is not currently supported. |
Scope |
Gets or sets whether a rule can be activated for recognition and when the rule can be referenced by other rules. |
Script |
This property is not currently supported. |
Methods
Add(SrgsElement) |
Adds an SrgsElement to an SrgsRule object. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |