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

S P A C E D Out!

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

S P A C E D Out!

Post by Chris »

My code allows an end user to spell out his/her name.
It can spell out the N A M E back to the end user.
And it inserts the N A M E into the MySQL db,
but it adds S P A C E S between the letters.

Now, 2 questions:
How can I get it to say the NAME back to the end user instead of spelling it out?
And, how can I make it stop inserting spaces between the letters.

Obviously the S P A C E S are the problem in both cases.
How can I get them out? That should answer both questions.
Thanks,
Chris

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

IVR code needed to determine cause of extra spacing

Post by support »

Hi Chris,

Can you provide us with a small snippet of IVR code so that we can better understand this IVR issue?

Regards,
Plum Support
Last edited by support on Thu Feb 18, 2010 3:55 pm, edited 2 times in total.

Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

Post by Chris »

Okay, here's the code.

Code: Select all

 <!-- /////////////////////// SPELL NAME ////////////////// -->

<form id="name">
<field name="spell_name">
<grammar src="../grammars/spell.xml" root="spell_name" type="application/srgs+xml" mode="voice"/>
<prompt  bargein="false">

Please spell out your name in a clear voice. Do it now!
</prompt>
</field>
<block>
     <prompt bargein="false">

Okay, I think I heard, <value expr="spell_name.toString()"/>. Did I get the spelling correct? 
         
     </prompt>
<assign name="p_first_name" expr="spell_name"/>
<goto next="#Verify_name"/>
</block>

<noinput count="5"> I'm waiting! <goto next="#name"/></noinput>

</form>

[/code]
Thanks,
Chris

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

IVR post to fix spacing issue

Post by support »

Hi Chris,

An IVR topic similar to this was posted here:

http://support.plumvoice.com/viewtopic.php?t=927

If this post doesn't help, could you also post your IVR grammar file (spell.xml) here so we can see how you are implementing it?

Regards,
Plum Support
Last edited by support on Thu Feb 18, 2010 3:55 pm, edited 3 times in total.

Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

Post by Chris »

The link above was not helpful.
Here is the grammar you requested. As you can see I picked it up from another grammar that collects email addresses. That also puts S P A C E S into the result or value.

spell_name:

Code: Select all

<?xml version="1.0" ?>
<grammar mode="voice" root="email" xml:lang="en_us">
<rule id="email" scope="public">
<one-of>
<item repeat="1-">
<ruleref uri="#emailchars" />
</item>
</one-of>
</rule>
<rule id="emailchars" scope="private">
<one-of>
<item>A<tag>SWI_literal="a"</tag></item>
<item>B<tag>SWI_literal="b"</tag></item>
<item>C<tag>SWI_literal="c"</tag></item>
<item>D<tag>SWI_literal="d"</tag></item>
<item>E<tag>SWI_literal="e"</tag></item>
<item>F<tag>SWI_literal="f"</tag></item>
<item>G<tag>SWI_literal="g"</tag></item>
<item>H<tag>SWI_literal="h"</tag></item>
<item>I<tag>SWI_literal="i"</tag></item>
<item>J<tag>SWI_literal="j"</tag></item>
<item>K<tag>SWI_literal="k"</tag></item>
<item>L<tag>SWI_literal="l"</tag></item>
<item>M<tag>SWI_literal="m"</tag></item>
<item>N<tag>SWI_literal="n"</tag></item>
<item>O<tag>SWI_literal="o"</tag></item>
<item>P<tag>SWI_literal="p"</tag></item>
<item>Q<tag>SWI_literal="q"</tag></item>
<item>R<tag>SWI_literal="r"</tag></item>
<item>S<tag>SWI_literal="s"</tag></item>
<item>T<tag>SWI_literal="t"</tag></item>
<item>U<tag>SWI_literal="u"</tag></item>
<item>V<tag>SWI_literal="v"</tag></item>
<item>W<tag>SWI_literal="w"</tag></item>
<item>X<tag>SWI_literal="x"</tag></item>
<item>Y<tag>SWI_literal="y"</tag></item>
<item>Z<tag>SWI_literal="z"</tag></item>
<item>hyphen<tag>SWI_literal="-"</tag></item>
<item>dash<tag>SWI_literal="-"</tag></item>
<item>at<tag>SWI_literal="@"</tag></item>
</one-of>
</rule>
</grammar>
Thanks,
Chris

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

IVR grammar solution to spacing issues

Post by support »

Hi Chris,

With the way you have implemented your IVR grammar, it is not possible to have the user spell out his/her name and then have the IVR system say the name back to the user.

You could try using our built-in IVR grammar to capture a user's first name and last name, where users can say and spell their names:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<property name="sensitivity" value="0.8"/>
<property name="confidencelevel" value="0.2"/>

<form id="name">
<field name="lastname">
     <grammar src="http://vxml.plumgroup.com/grammars/lastname.php" root="lastname"
     type="application/srgs+xml" mode="voice"/>
     <prompt bargein="false">
          Say your last name and spell it.
     </prompt>
     <filled>
          You said <value expr="lastname"/>.
     </filled>
</field>

<field name="firstname">
     <grammar src="http://vxml.plumgroup.com/grammars/firstname.php" root="firstname"
     type="application/srgs+xml" mode="voice"/>
     <prompt bargein="false">
          Say your first name and spell it.
     </prompt>
     <filled>
          You said <value expr="firstname"/>.
     </filled>
</field>
</form>
</vxml>
You should notice that "lastname" and "firstname" have no spaces in between them.

Hope this helps.

Regards,
Plum Support
Last edited by support on Thu Feb 18, 2010 3:56 pm, edited 3 times in total.

Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

S P A C E S.

Post by Chris »

Your firstname and lastname grammars are insufficient and restrictive.

They don't recognize "Bokyoung" or "Nobo" or many many asian names. And sometimes I need words that are not names at all.
That's why I'm trying to get the vxml to allow spelling.
It works except for the added S P A C E S.

There must be a solution.
Like the opposite of ACRONYM, maybe?
Thanks,
Chris

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

More specific IVR code to rectify spacing issue in names

Post by support »

Hi Chris,

You could use this as possible solution to remove the spaces in between your name. For IVR example if you had the following name for the variable "spell_name":

Code: Select all

<var name="spell_name" expr="'j o e'"/>
You could use this to remove the spaces within a name stored in a variable called 'blah':

Code: Select all

<var name="spell_name" expr="blah.replace(/ /g, '')"/>
Hope this sample IVR code helps.

Regards,
Plum Support
Last edited by support on Thu Feb 18, 2010 3:56 pm, edited 4 times in total.

Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

.replace(/ /g, '')"/>

Post by Chris »

I made a slight change to .replace(/ /g, '')"/>
and it seems to work. Thank you very much.
What does this code mean? .replace(/ /g, '')"/>

When it plays back the name sometimes it's too fast to recognize.
How can you slow it down?

Also even though the spelling has stopped in the VXML
and the log file shows the spaces have been removed,
it still puts the spaces in the MySQL db!
Any ideas on why or how to fix that?
Thanks,
Chris

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

IVR link to show prosody tag

Post by support »

Hi Chris,

.replace(/ /g, '') just means that whereever there is a space (/ /g), replace it with no space ('').

To slow down the name, you can use the IVR tag, prosody.

You would use the "rate" attribute of the <prosody> tag to slow down the name.

As for the spaces in the MySQL db, can you provide with the IVR code of how you are inputting it into your db?

Regards,
Plum Support
Last edited by support on Wed Feb 24, 2010 3:27 pm, edited 5 times in total.

Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

submit without spaces

Post by Chris »

Thanks for looking into this. The following is the submit tag:

Code: Select all

<submit method="post" namelist="p_phone p_first_name" next="AddToDB/enter_VXML_data.php"/>
And here's the code for enter_VXML_data.php:

Code: Select all

$link_id = mysql_connect ($dbhost, $dbusername, $dbuserpass);

if (!mysql_select_db($dbname)) die(mysql_error());

$query="INSERT INTO web_enrollment (p_phone,p_first_name)
VALUES ('$_POST[p_phone]','$_POST[p_first_name]')";

if(!mysql_db_query($dbname,$query,$link_id)) die(mysql_error());
echo("<?xml version=\"1.0\"?>\n");
?> 
Thanks,
Chris

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

IVR code example for submit with no spaces

Post by support »

Hi Chris,

When you send "p_first_name" to your db, do you assign it the variable of the name with no spaces in it?

For IVR example:

Code: Select all

<var name="blah" expr="'j o e'"/> 
<var name="spell_name" expr="blah.replace(/ /g, '')"/> 
<assign name="p_first_name" expr="spell_name"/> 
Hope this IVR code example helps.

Regards,
Plum Support
Last edited by support on Thu Feb 18, 2010 3:57 pm, edited 3 times in total.

Chris
Posts: 64
Joined: Wed Jul 23, 2008 12:50 pm

SPACES are GONE!

Post by Chris »

You did it!
Kisses to you!

I tried to apply the same code to the portion where I collect e-mail addresses. That works too. It puts the e-mail addresses in the db without the spaces.

But I've noticed that, when I ask end users to spell their email addresses. The vxml does not wait until they are finished.
It cuts them off in the middel of the address even if they are not pausing during the spelling input.
How can I force it to wait until there is silence?
And I need to do that without effecting the other fields that are working properly. Got any secrets?
Thanks,
Chris

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

IVR app needs to increase value of incompletetimeout

Post by support »

Hi Chris,

Someone from a previous IVR post had attempted to capture e-mail addresses as well:

http://support.plumvoice.com/viewtopic.php?t=955

However, due to the limitations of speech recognition in general, it is difficult
to capture entirely what the user is saying once you go beyond 5 characters being spelled.

You could try implementing an IVR grammar that uses the military phonetic alphabet to try to capture longer e-mail addresses, but please keep in mind that just as it is difficult for "human recognition" of spelling (i.e. m's and n's), it is just difficult for a speech recognition engine to capture a spelling IVR grammar.

As for allowing for more time until there is silence so that the user doesn't get cut off, you try increasing the value of the IVR property, incompletetimeout:

http://www.plumvoice.com/docs/dev/voice ... etetimeout

Regards,
Plum Support

Post Reply