SrgsDocument 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
定义设计时对象,该对象用于生成符合 语音识别语法规范 (SRGS) 版本 1.0 的强类型运行时语法。
public ref class SrgsDocument
public class SrgsDocument
[System.Serializable]
public class SrgsDocument
type SrgsDocument = class
[<System.Serializable>]
type SrgsDocument = class
Public Class SrgsDocument
- 继承
-
SrgsDocument
- 属性
注解
重要
将此类型的实例用于不受信任的数据是一种安全风险。 仅将此对象与受信任的数据一起使用。 有关详细信息,请参阅验证所有输入。
可以通过添加表示 SRGS 元素的类实例(例如SrgsRule、SrgsOneOf、SrgsItem、SrgsRuleRef和SrgsSemanticInterpretationTagSrgsToken)来构造空SrgsDocument实例并生成语法。 还可以从现有符合 SRGS 的 XML 语法文件、SrgsRule实例或实例构造SrgsDocument实例GrammarBuilder。
SrgsDocument创建对象后,可以将其加载到对象Grammar中或通过SrgsGrammarCompiler编译对象,使对象能够读取Grammar该对象。
构造函数
| 名称 | 说明 |
|---|---|
| SrgsDocument() |
初始化 SrgsDocument 类的新实例。 |
| SrgsDocument(GrammarBuilder) |
从SrgsDocument对象初始化类的新实例GrammarBuilder。 |
| SrgsDocument(SrgsRule) |
初始化类的新实例 SrgsDocument ,并指定要 SrgsRule 成为语法的根规则的对象。 |
| SrgsDocument(String) |
初始化类的新实例,该实例 SrgsDocument 指定用于填充实例的 SrgsDocument XML 文档的位置。 |
| SrgsDocument(XmlReader) |
从引用 XML 格式语法文件的实例初始化类的新实例SrgsDocumentXmlReader。 |
属性
| 名称 | 说明 |
|---|---|
| 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 基 URI。 |
方法
| 名称 | 说明 |
|---|---|
| Equals(Object) |
确定指定的对象是否等于当前对象。 (继承自 Object) |
| GetHashCode() |
用作默认哈希函数。 (继承自 Object) |
| GetType() |
获取当前实例的 Type。 (继承自 Object) |
| MemberwiseClone() |
创建当前 Object的浅表副本。 (继承自 Object) |
| ToString() |
返回一个表示当前对象的字符串。 (继承自 Object) |
| WriteSrgs(XmlWriter) |
将对象的内容 SrgsDocument 写入符合 语音识别语法规范 (SRGS) 版本 1.0 的 XML 格式语法文件。 |