2009-10-07 41 views
0

我有這樣的Windows語音識別(WSRMacro)腳本化合物被說成一個字多的話:如何從候補面板輸出推斷調試信息WSR

"Happy children" 
-> "Happychildren" 

然而,在腳本中的錯誤在某些情況下出現,我不知道如何推斷出問題所在。雖然上面的例子中工作,下列不:

"Happy children bake a cake" 

而是複利如上面的字時,候補小組出現以下提示:

-> Alternates Panel (Say the number next to the item you want followed by OK): 
(1) Replace that withhappychildrenbakeacake 
(2) replace that withhappychildrenbakeacake 
(3) replace that with no space happy no space 
    children no space bake no space a no space cake 

我可以推斷任何特定的錯誤的下面的替代面板輸出腳本?

或者有什麼我可以添加到腳本獲得更多有用的反饋關於錯誤的性質?

<command priority="5"> 
    <listenFor>compound that</listenFor> 
    <emulateRecognition>select that</emulateRecognition> 
    <sendKeys>{250 WAIT}{{CTRL}}c{250 WAIT}</sendKeys> 
    <script language="VBScript"> 
     <![CDATA[ 
     that = Application.clipboardData.GetData("text") 
     Set regEx = New RegExp 
     regEx.Pattern = "[^\s\w,;:]" 
     If regEx.Test(that) Then 
     Application.SetTextFeedback("Try again without any punctuation selected") 
     Else 
     regEx.Pattern = "(\s) *(\S)" 
     regEx.Global = True 
     that = regEx.Replace(" " & that, "$1no space $2") 
     On Error Resume Next 
     Application.EmulateRecognition("replace that with" & that) 
     If 0 <> Err.Number Then 
      Application.SetTextFeedback("Try again with only the digits selected") 
     End If 
     End If 
    ]]> 
    </script> 
    </command> 

回答

0

聽起來就像你試圖在一個本來不支持Text Service Framework的應用程序中使用它。

更嚴重的是,爲什麼不使用內建命令「從該空間刪除空格」或「連接該空格」?