c# - 带通配符的 SpeechRecognitionEngine 语法

标签 c# .net speech-recognition grammar

我们想使用 XML 文件作为语法,列出我们系统的所有命令,

但是,其中一个命令将是 “查找用户 xxxxxx”,其中 xxxxx 是一个唯一的编号。

是否可以在语法 xml 文件中创建此“通配符/搜索项”

最佳答案

尝试在 grxml 文件中组合使用两个规则。

接受个人号码的第一条规则:

  <rule id="SmallNum" scope="public">
    <one-of>
      <item>One</item>
      <item>Two</item>
      <item>Three</item>
      <item>Four</item>
      <item>Five</item>
      <item>Six</item>
      <item>Seven</item>
      <item>Eight</item>
      <item>Nine</item>
      <item>Zero</item>
    </one-of>
  </rule>

从指定数量的号码构建帐号的第二条规则:

  <rule id="AccountNumber" scope="public">
    <item repeat="0-1">AccountNumber</item>
    <item   repeat="3">
      <ruleref uri="#SmallNum"/>
    </item>
  </rule>

关于c# - 带通配符的 SpeechRecognitionEngine 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22337648/

相关文章:

C# : interface : same method in 2 interfaces

c# - 当@Model 是任务时访问@Model

c# - 无效的组名 : Group names must begin with a word character

c# - 生成随机唯一代码

speech-recognition - 通过 SAPI 4 接口(interface)连接到 Naturallyspoken 可以吗?

c# - EntityTypeBuilder<T> ASP.NET Core 2 Entity Framework 中的 OnDelete

c# - 无边框形式的 Windows 7 风格 Dropshadow

.net - 无法在 Windows XP 上运行 Visual Studio 2012 程序

c# - 语法语言与语音识别器的语言不匹配

javascript - Google WebSpeech API 抛出 'not-allowed' 麦克风权限错误