Combine free-form dictation and semantic in a srgs grammar

只谈情不闲聊 提交于 2019-12-01 14:11:54

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.

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!