We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

multiple grammar

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
nrv2008
Posts: 7
Joined: Mon May 19, 2008 12:58 pm

multiple grammar

Post by nrv2008 »

Hi,

Just curious with multiple grammar.

my first grammar has "california" and the other one has all the 52 states including california.

If I say california, does the system will still process the second grammar when it
is already in first grammar?



<grammar type="application/x-jsgf" mode="voice">
california
</grammar>
<grammar type="application/x-jsgf" mode="voice">
Alabama|Alaska| Arizona| Arkansas| California| Colorado|
Connecticut| Delaware | District of Columbia| Florida|
Georgia| Hawaii| Idaho| Illinois| Indiana| Iowa| Kansas|
Kentucky| Louisiana| Maine| Maryland| Massachusetts|
Michigan| Minnesota| Mississippi| Missouri| Montana|
Nebraska| Nevada| New Hampshire| New Jersey| New Mexico| New York| North Carolina| North Dakota| Ohio|
Oklahoma| Oregon| Pennsylvania| Rhode Island| South
Carolina| South Dakota| Tennessee| Texas| Utah| Vermont|
Virginia| Washington| West Virginia| Wisconsin| Wyoming
</grammar>

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR system will search multiple grammars for a match

Post by support »

Hi,

When the page is first loaded, the IVR system processes all the IVR grammars. So, to answer your question, the IVR system will search both IVR grammars for a match when you say "California".

Regards,
Plum Support
Last edited by support on Fri Feb 19, 2010 10:48 am, edited 2 times in total.

nrv2008
Posts: 7
Joined: Mon May 19, 2008 12:58 pm

Post by nrv2008 »

So, does it mean that the first grammar is just appended to second grammar.. meaning it will be loaded as California|Alabama|Alaska| Arizona| Arkansas| California...

How the system process the match? Is it by Order? If I say "California" I have it in item 1 and item 6 in combining the two grammar. I was hoping that system will match it to item 1 because this will be the purpose of my project is to have the first grammar as the selected states and the second grammar will be the lookup if it is not in the first grammar.



Thanks,

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Scope your grammars in IVR system

Post by support »

Hi,

Since your utterance would match both of these IVR grammars, the behavior of which IVR grammar it will be matched with is ambiguous. To make your grammar more reliable, I would recommend scoping your grammars so that your inner-most scoped grammar takes precedence over your other grammars.

For example, if you had the following IVR code:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<form>
  <grammar type="application/x-jsgf" mode="voice">
    california
  </grammar> 
  <field>
    <grammar type="application/x-jsgf" mode="voice">
      utah
    </grammar>
  </field>
</form>
</vxml>
The IVR grammar inside of the <field> tags would take precedence over the IVR grammar inside the <form>tags.

Regards,
Plum Support
Last edited by support on Fri Feb 19, 2010 10:49 am, edited 4 times in total.

nrv2008
Posts: 7
Joined: Mon May 19, 2008 12:58 pm

Post by nrv2008 »

Thanks!!! I followed your recommendation and so far I have no problem and it seems that field tag taking precendence over the grammar inside the <form>.

Post Reply