Combine free-form dictation and semantic in a srgs grammar

后端 未结 2 352
梦谈多话
梦谈多话 2021-01-07 15:45

I\'m trying to combine both the result of a semantic and a dictation request in the semantic value of a SRGS document. For example, I would say \"Search potato\" and the out

相关标签:
2条回答
  • 2021-01-07 15:59

    If you look at the W3C paper "Extending SRGS to Support More Powerful and Expressive Grammars" you can see that this standards group sees the need for just the scenario you are mentioning (see example 1.a) but it currently is not supported in the SRGS standard. Your question is how to do this with SRGS but there are probably ways to achieve the same results outside of SRGS dependent upon the ASR platform being used.

    0 讨论(0)
  • 2021-01-07 16:09

    I have also searched high and low for this, and have finally found the answer. I have used the following code and loaded it into System.Speech.Recognition.Grammar and it works perfectly.

    <ruleref uri="grammar:dictation" type="application/srgs+xml"/>
    

    Just add this ruleref as an item wherever you want to get the dictated text. You can pull out the dictated text into a semantic/tag by using this directly after the ruleref:

    <tag>out.SpokenText=rules.latest();</tag>
    
    0 讨论(0)
提交回复
热议问题