Free-form text with custom SRGS based Grammar

末鹿安然 提交于 2019-12-05 20:53:22

You can mix dictation mode with grammar mode, see this example from MSDN:

http://msdn.microsoft.com/en-us/library/ms723634(v=vs.85).aspx

<GRAMMAR>
    <!-- command to handle first and last names with semantic properties -->
    <!-- By using semantic properties, the application can ignore all of
        the text returned, except for the text associated with the dictation
        tags' semantic properties "PID_FirstName" and "PID_LastName" -->
    <RULE ID="SubmitName" TOPLEVEL="ACTIVE">
        <P>
            my first name is
            <!-- Note the implicit maximum is only one word -->
            <DICTATION PROPID="PID_FirstName"/>
            and my last name is
            <!-- Note the implicit maximum is two words -->
            <DICTATION PROPID="PID_LastName" MAX="2"/>
        </P>
    </RULE>
</GRAMMAR>

Take a look at the GARBAGE special rule. I'm not sure how you would then retrieve the words that matched the garbage section, but I'm pretty sure there is a way.

Let me know if you figure it out as I'm interested on the subject too :).

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