SrgsDocument 类

定义

定义用于生成强类型的运行时语法的设计时对象,符合语音识别语法规范 (SRGS) 1.0 版

public ref class SrgsDocument
[System.Serializable]
public class SrgsDocument
public class SrgsDocument
[<System.Serializable>]
type SrgsDocument = class
type SrgsDocument = class
Public Class SrgsDocument
继承
SrgsDocument
属性

注解

可以通过添加表示 SRGS 元素的类实例(例如 、、SrgsOneOfSrgsItemSrgsRuleRefSrgsSemanticInterpretationTag、 和 )SrgsRule来构造空SrgsDocument实例并SrgsToken生成语法。 还可以从符合 SRGS 的现有 XML 语法文件、实例或 的实例SrgsRule构造SrgsDocument实例GrammarBuilder

创建 SrgsDocument 对象后,可以将其加载到 Grammar 对象中,也可以由 SrgsGrammarCompiler编译,使对象能够读取 Grammar 该对象。

有关详细信息和示例,请参阅系统语音编程指南中的使用 SrgsGrammar 创建语法,了解.NET Framework。

构造函数

SrgsDocument()

初始化 SrgsDocument 类的新实例。

SrgsDocument(GrammarBuilder)

SrgsDocument 对象初始化 GrammarBuilder 类的新实例。

SrgsDocument(SrgsRule)

初始化 SrgsDocument 类的新实例并指定一个 SrgsRule 对象成为语法的根规则。

SrgsDocument(String)

初始化指定填充 SrgsDocument 实例的 XML 文档的位置的 SrgsDocument 类的新实例。

SrgsDocument(XmlReader)

初始化 SrgsDocument 类的新实例,该类来自引用 XML 格式语法文件的 XmlReader 的实例。

属性

AssemblyReferences

获取 SrgsDocument 的程序集引用信息。

CodeBehind

获取 SrgsDocument 实例的代码隐藏信息。

Culture

获取或设置 SrgsDocument 的区域性信息。

Debug

获取或设置行号是否应添加至内联脚本。

ImportNamespaces

获取当前 SrgsDocument 实例的相关命名空间。

Language

获取或设置用于 SrgsDocument 类中的内联代码的编程语言。

Mode

获取或设置 SrgsDocument 类的模式。

Namespace

获取或设置 SrgsDocument 类的命名空间。

PhoneticAlphabet

获取或设置 SrgsDocument 类的注音字母表。

Root

获取或设置 SrgsDocument 的根规则。

Rules

获取目前已为 SrgsDocument 类定义的规则的集合。

Script

获取或设置 SrgsDocument 类的 .NET 脚本语音。

XmlBase

获取或设置 SrgsDocument 的基 URL 类。

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()

返回表示当前对象的字符串。

(继承自 Object)
WriteSrgs(XmlWriter)

SrgsDocument 对象的内容写入符合语音识别语法规范 (SRGS) 1.0 版的 XML 格式语法文件。

适用于

另请参阅