Page 1 of 1

Builtin digit grammar plus "#"

Posted: Fri Feb 25, 2005 1:20 pm
by labbruzzesi
Hello Plum Team,

I have been trying to use the builtin digit grammar for a field. I would like the user to terminate input with '#' which works fine by default. But I also would like to accept only '#' (which is used to back up to a previous dialog).

'#' and '*' are the only keys that throw a nomatch in the builtin digits grammar.

I tried this first:

<field name="newPassword" type="digits"> (no specific length)
<grammar>"#"</grammar>

but when a digits were terminated with '#', all that was in the field was the '#'.

I am now doing the following :

<field name="newPassword" type="digits"> (no specific length)
<grammar>"*"</grammar>

The only thing that can throw a nomatch is now the '#'.......... this method allows terminating digits with '#' and entering '#' by itself. When there is a nomatch, I know that '#' was entered by itself.

Is there a more elegant way to accomplish this?

Thank you

Lou Abbruzzesi

IVR platform matches # whenever it's pressed

Posted: Mon Feb 28, 2005 6:09 pm
by support
Hello,

The problem you are running into is that JSGF grammars (the default for Plum IVR systems) are inclusive by default. This means that when you specify an IVR grammar containing only "#" you will have match not only # but also 1234# etc. Also, the Plum IVR system will match grammars in reverse order of appearance when they are in the same scope. These two things cause the IVR platform to match # whenever it is pressed. The most elegant way to correct this is to specify to the grammar engine that you wish to match # only when it is pressed by itself. The IVR grammar for this case is:

Code: Select all

<grammar>^"#"$</grammar>

This will force the platform to only match # if it was the only key pressed.

Hope This Helps!

Plum Support