Page 1 of 1

multiple grammar

Posted: Tue May 20, 2008 12:18 pm
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>

IVR system will search multiple grammars for a match

Posted: Tue May 20, 2008 2:13 pm
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

Posted: Tue May 20, 2008 2:51 pm
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,

Scope your grammars in IVR system

Posted: Tue May 20, 2008 4:02 pm
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

Posted: Tue May 20, 2008 5:41 pm
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>.