SrgsRule Class

 

Represents a grammar rule.

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

System.Object
  System.Speech.Recognition.SrgsGrammar.SrgsRule

[<SerializableAttribute>]
type SrgsRule = class end

NameDescription
System_CAPS_pubmethodSrgsRule(String)

Initializes a new instance of the SrgsRule class and specifies the identifier for the rule.

System_CAPS_pubmethodSrgsRule(String, SrgsElement[])

Initializes a new instance of the SrgsRule class from an array of SrgsElement objects.

NameDescription
System_CAPS_pubpropertyBaseClass

This property is not currently supported.

System_CAPS_pubpropertyElements

Gets the collection of SrgsElement objects in the SrgsRule instance.

System_CAPS_pubpropertyId

Gets or sets the identifier for the rule.

System_CAPS_pubpropertyOnError

This property is not currently supported.

System_CAPS_pubpropertyOnInit

This property is not currently supported.

System_CAPS_pubpropertyOnParse

This property is not currently supported.

System_CAPS_pubpropertyOnRecognition

This property is not currently supported.

System_CAPS_pubpropertyScope

Gets or sets whether a rule can be activated for recognition and when the rule can be referenced by other rules.

System_CAPS_pubpropertyScript

This property is not currently supported.

NameDescription
System_CAPS_pubmethodAdd(SrgsElement)

Adds an SrgsElement to an SrgsRule object.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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.

.NET Framework
Available since 3.0

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

Return to top
Show: