Share via


SrgsRule Class

Represents a grammar rule.

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

Syntax

'Declaration
<SerializableAttribute> _
Public NotInheritable Class SrgsRule
[SerializableAttribute] 
public sealed class SrgsRule
[SerializableAttribute] 
public ref class SrgsRule sealed
/** @attribute SerializableAttribute() */ 
public final class SrgsRule
SerializableAttribute 
public final 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 phrases defined by grammar rules form the basis of the recognizer's language model in the Microsoft.Speech.Recognition.SrgsGrammar namespace. This basis limits the set of possible phrases that the recognizer must be able to recognize.

A rule consists of child elements that specify the sequence in which the phrases must be spoken. These elements are represented by objects such as SrgsItem, SrgsOneOf, and SrgsRuleRef elements. Use the Elements property to access the collection of child elements a rule contains.

You can specify whether a rule can be activated for recognition and when it can be referenced by other rules by using the Scope property.

This class represents the rule element that is defined in the World Wide Web Consortium (W3C) Speech Recognition Grammar Specification (SRGS).

Inheritance Hierarchy

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

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

SrgsRule Members
Microsoft.Speech.Recognition.SrgsGrammar Namespace

Other Resources

Speech Recognition Grammar Specification Version 1.0