How to define a grammar of numbers and asterisk for a field?
Posted: Tue Jun 22, 2004 3:55 pm
I want it to be defined in ABNF-XML (SRGS-XML) so my application is as platform independent as possible. I used the SRGS spec as a reference: http://www.w3.org/TR/speech-grammar/
The digits built-in grammar doesn't work for me since I need to support phone extensions (asterisk). Since PlumVoice does not support the phone or telephone built-in grammar, I have to create one myself that supports phone extensions. This is what I've been able to come up with, but the asterisk still isn't recogized:
The digits built-in grammar doesn't work for me since I need to support phone extensions (asterisk). Since PlumVoice does not support the phone or telephone built-in grammar, I have to create one myself that supports phone extensions. This is what I've been able to come up with, but the asterisk still isn't recogized:
Code: Select all
<field name="callbackNumField">
<grammar type="application/srgs+xml" root="phone">
<rule id="values">
<one-of>
<item> 0 </item>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
<item> 4 </item>
<item> 5 </item>
<item> 6 </item>
<item> 7 </item>
<item> 8 </item>
<item> 9 </item>
<item> "*" </item>
</one-of>
</rule>
<rule id="phone" scope="public">
<one-of>
<item>
<item repeat="0-"><ruleref uri="#values"/></item>
</item>
</one-of>
</rule>
</grammar>
<prompt>
Please enter the phone number, including area code,
where you may be contacted. Use * to specify an extension.
</prompt>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
</field>