SrgsRuleRef 类

定义

表示指定对规则引用的语法元素。Represents the grammar element that specifies a reference to a rule.

public ref class SrgsRuleRef : System::Speech::Recognition::SrgsGrammar::SrgsElement
[System.Serializable]
public class SrgsRuleRef : System.Speech.Recognition.SrgsGrammar.SrgsElement
[<System.Serializable>]
type SrgsRuleRef = class
    inherit SrgsElement
Public Class SrgsRuleRef
Inherits SrgsElement
继承
属性

注解

SrgsRuleRef如果要重用已经定义了内容的元素,则类特别有用 SrgsRuleThe SrgsRuleRef class is particularly useful when you want to reuse an SrgsRule element whose contents have already been defined. 通过重复使用现有规则,可以更快地生成复杂的语法。By reusing existing rules, you can build complex grammars more quickly.

如果满足以下条件,则可以使用类的构造函数之一 SrgsRuleRef 来引用 SrgsRule 对象或 rule 元素:You can use one of the constructors of the SrgsRuleRef class to reference an SrgsRule object or a rule element if the following is true:

  • SrgsRule对象在包含语法中,其属性的值 ScopePublicPrivateThe SrgsRule object is in the containing grammar and the value of its Scope property is Public or Private.

  • rule元素位于外部语法中,其属性的值 scopepublicThe rule element is in an external grammar and the value of its scope attribute is public.

  • rule元素属于外部语法,其属性的值 scopeprivate ,并且声明为 root rule 外部语法的。The rule element is in an external grammar, the value of its scope attribute is private, and it is declared as the root rule of the external grammar.

此类表示 ruleref 万维网联合会 (W3C) 语音识别语法规范中定义的元素 (SRGS) 版本 1.0This class represents the ruleref element as defined in the World Wide Web Consortium (W3C) Speech Recognition Grammar Specification (SRGS) Version 1.0. 有关 SRGS 元素的信息 ruleref 以及有关其对 ruleref 的支持的详细信息,请参阅 元素For information about the SRGS ruleref element and details about its support by System.Speech, see ruleref Element.

构造函数

SrgsRuleRef(SrgsRule)

初始化 SrgsRuleRef 类和指定引用的规则的新实例。Initializes a new instance of the SrgsRuleRef class and specifies the rule to reference.

SrgsRuleRef(SrgsRule, String)

初始化 SrgsRuleRef 类的新实例,指定引用规则和包含一语义键的字符串。Initializes a new instance of the SrgsRuleRef class, specifying the rule to reference and a string that contains a semantic key.

SrgsRuleRef(SrgsRule, String, String)

初始化 SrgsRuleRef 类的新实例,指定要引用的规则,语义字典的字符串别名和初始参数。Initializes a new instance of the SrgsRuleRef class, specifying the rule to reference, the string alias of the semantic dictionary, and initialization parameters.

SrgsRuleRef(Uri)

初始化 SrgsRuleRef 类的新实例并指定要引用的外部语法文件的位置。Initializes a new instance of the SrgsRuleRef class and specifies the location of the external grammar file to reference.

SrgsRuleRef(Uri, String)

初始化 SrgsRuleRef 类的新实例,指定要引用的外部语法文件的位置和规则的标识符。Initializes a new instance of the SrgsRuleRef class, specifying the location of the external grammar file and the identifier of the rule to reference.

SrgsRuleRef(Uri, String, String)

初始化 SrgsRuleRef 类的新实例,指定外部语法文件的位置,规则的标识符和语义字典的字符串别名。Initializes a new instance of the SrgsRuleRef class, specifying the location of the external grammar file, the identifier of the rule, and the string alias of the semantic dictionary.

SrgsRuleRef(Uri, String, String, String)

初始化 SrgsRuleRef 类的新实例,指定外部语法文件的位置,规则的标识符,语义字典的字符串别名和初始参数。Initializes a new instance of the SrgsRuleRef class, specifying the location of the external grammar file, the identifier of the rule, the string alias of the semantic dictionary, and initialization parameters.

字段

Dictation

定义可与与此语法关联的听写主题定义的朗读输入匹配的规则。Defines a rule that can match spoken input as defined by the dictation topic associated with this grammar.

Garbage

定义可与任何语音(到下一个规则匹配、下一个标记、或知道朗读输入结束)匹配。Defines a rule that can match any speech up to the next rule match, the next token, or until the end of spoken input.

MnemonicSpelling

指示语音输入可以包含单词的拼写的字母,并且拼写的字母可以识别为单词。Indicates that speech input can contain spelled-out letters of a word, and that spelled-out letters can be recognized as a word.

Null

定义在缺少任何音频输入时自动匹配的规则。Defines a rule that is automatically matched in the absence of any audio input.

Void

定义不能朗读的规则。Defines a rule that can never be spoken. 将 VOID 插入到序列中自动使该序列不能口述。Inserting VOID into a sequence automatically makes that sequence unspeakable.

属性

Params

获取 SrgsRuleRef 元素的初始化参数。Gets the initialization parameters for a SrgsRuleRef element.

SemanticKey

获取语义字典的别名字符串。Gets an alias string for the semantic dictionary.

Uri

获取此 SrgsRuleRef 元素引用的规则的 URI。Gets the URI for the rule that this SrgsRuleRef element references.

方法

CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetLifetimeService()
已过时。

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InitializeLifetimeService()
已过时。

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于