Can Range be defined in Grammer
Posted: Fri Mar 27, 2009 5:34 am
Hi
I have a requirement something like this.
User should be prompted with a message to input how many days before he wants to get an alert? Means like if he "SAYS" 23 days that means that 23 days before a schedule meeting time will update the user that he has an appointment 23 days from today.
Now I want to know if we can define range while defining voice mode grammer... I actually want the field to store value like 23 days when user says "twenty three days"
<grammar type="application/x-jsgf" mode="voice">
(one{1} | two{2} .. onehundred{100})+(years|year|months|month|days|day|weeks|week)
</grammar>
Here is the code
------------------------------------
<?xml version="1.0"?>
<vxml version="2.0">
<form id="date_frm">
<field name="alertBefore">
<grammar type="application/x-jsgf" mode="voice">
(one{1} | two{2} .. onehundred{100})+(years|year|months|month|days|day|weeks|week)
</grammar>
<prompt>
Enter how many days before you want the alert?
</prompt>
<filled>
you entered <value expr="alertBefore"/>
<reprompt/>
</filled>
</field>
</form>
</vxml>
I have a requirement something like this.
User should be prompted with a message to input how many days before he wants to get an alert? Means like if he "SAYS" 23 days that means that 23 days before a schedule meeting time will update the user that he has an appointment 23 days from today.
Now I want to know if we can define range while defining voice mode grammer... I actually want the field to store value like 23 days when user says "twenty three days"
<grammar type="application/x-jsgf" mode="voice">
(one{1} | two{2} .. onehundred{100})+(years|year|months|month|days|day|weeks|week)
</grammar>
Here is the code
------------------------------------
<?xml version="1.0"?>
<vxml version="2.0">
<form id="date_frm">
<field name="alertBefore">
<grammar type="application/x-jsgf" mode="voice">
(one{1} | two{2} .. onehundred{100})+(years|year|months|month|days|day|weeks|week)
</grammar>
<prompt>
Enter how many days before you want the alert?
</prompt>
<filled>
you entered <value expr="alertBefore"/>
<reprompt/>
</filled>
</field>
</form>
</vxml>