簡體   English   中英

帶有通配符的SpeechRecognitionEngine語法

[英]SpeechRecognitionEngine grammar with wildcard

我們想使用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>

你問的是可能的...有多種方法可以做到...

更好的方法是使用機器學習方法編寫某種類型的智能,但是我懷疑您不想走那么遠,因此我建議“教”數字聽寫並使用SpeechHypothesized事件(我在另一篇文章中評論“因為我懷疑您會需要它)來組合單詞。

對您也有好處:

http://msdn.microsoft.com/zh-cn/library/ms873284.aspx (構建知識)

http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognitionengine.speechhypothesized(v=vs.110).aspx

祝好運

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM