We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Spell a word
Spell a word
Hi,
It looks like this is not possible but I wanted to double check. So if I want a user to spell their last
name and capture that this is not possible at this point correct? If I knew their last name up front
could I ask them to spell it and capture at least if it was accurate or not?
Thanks in advance!
Mike
It looks like this is not possible but I wanted to double check. So if I want a user to spell their last
name and capture that this is not possible at this point correct? If I knew their last name up front
could I ask them to spell it and capture at least if it was accurate or not?
Thanks in advance!
Mike
Re: Spell a word
Hi Mike,
Yes, this is possible. There is a built in last name grammar, though it only covers about 90% of the US population's last names. For more information, please take a look at the VXML documentation: http://www.plumvoice.com/docs/dev/devel ... ce:grammar
Regards,
Plum Support
Yes, this is possible. There is a built in last name grammar, though it only covers about 90% of the US population's last names. For more information, please take a look at the VXML documentation: http://www.plumvoice.com/docs/dev/devel ... ce:grammar
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Spell a word
Great thanks so much for the quick reply! So lets say I wanted the user to spell a random word
but I will know what the word is and ask them to spell it. Would I create a dynamic grammar
to achieve this?
Thanks again!
but I will know what the word is and ask them to spell it. Would I create a dynamic grammar
to achieve this?
Thanks again!
Re: Spell a word
Hi Mike,
Yes, you would have to create your own grammar. We think it would be best if you used the alphanum builtin grammar, which is currently undocumented. To limit the amount of mistakes that may occur while using it, you should modify your confidence and sensitivity properties. Here is a code example:
spelling_grammar.php would be the grammar you write using the builtin alphanum:
word_list.txt is simply a text file with the word(s) you want your users to spell:
Regards,
Plum Support
Yes, you would have to create your own grammar. We think it would be best if you used the alphanum builtin grammar, which is currently undocumented. To limit the amount of mistakes that may occur while using it, you should modify your confidence and sensitivity properties. Here is a code example:
Code: Select all
<form>
<field>
<property name="sensitivity" value="0.2"/>
<property name="confidencelevel" value="0.75"/>
<grammar src="spelling_grammar.php" type="application/srgs+xml"/>
<prompt>Spell the word example.</prompt>
<filled>You spelled example correctly.</filled>
</field>
</form>
Code: Select all
<?php
header('Content-type: text/xml');
echo '<?xml version="1.0"?>';
?>
<grammar root="spelling" mode="voice">
<rule id="spelling">
<ruleref uri="builtin:grammar/alphanum?entries=word_list.txt"/>
</rule>
</grammar>
Code: Select all
example
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Spell a word
Hi,
I have tried exactly what you have suggested and am getting the following
Any suggestions?
Thanks
I have tried exactly what you have suggested and am getting the following
Code: Select all
Sun 08 Jul 2012 08:20:24.0687 PM EDT (000001;024;1341791797) [inet] EVENT: Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
Sun 08 Jul 2012 08:20:24.0716 PM EDT (000001;024;1341791797) [vxi] EVENT: DocumentParser::FetchDocument(http://ec2-user@174.129.240.84:8999/spell.vxml)
Sun 08 Jul 2012 08:20:24.0716 PM EDT (000001;024;1341791797) [vxi] EVENT: Cache Miss: http://ec2-user@174.129.240.84:8999/spell.vxml
Sun 08 Jul 2012 08:20:24.0716 PM EDT (000001;024;1341791797) [inet] EVENT: Attempting to fetch http://ec2-user@174.129.240.84:8999/spell.vxml
Sun 08 Jul 2012 08:20:24.0749 PM EDT (000001;024;1341791797) [rec] EVENT: Cache Hit: http://ec2-user@174.129.240.84:8999/spelling_grammar.php
Sun 08 Jul 2012 08:20:24.0754 PM EDT (000001;024;1341791797) [rec] ERROR: Error creating grammar
Thanks
Re: Spell a word
Hi,
Just a bit of clarification on the earlier example we posted.
Within spelling_grammar.php, you will want to reference the full URL of where word_list.txt exists. For example:
Hope this helps.
Regards,
Plum Support
Just a bit of clarification on the earlier example we posted.
Within spelling_grammar.php, you will want to reference the full URL of where word_list.txt exists. For example:
Code: Select all
<?php
header('Content-type: text/xml');
echo '<?xml version="1.0"?>';
?>
<grammar root="spelling" mode="voice">
<rule id="spelling">
<item>
<ruleref uri="builtin:grammar/alphanum?entries=http://myserver.com/code_examples/word_list.txt"/>
</item>
</rule>
</grammar>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Spell a word
thanks I will try this out
Re: Spell a word
Hi,
I am still getting the same error when I try this...
here is my code
Thanks
Mike
I am still getting the same error when I try this...
Code: Select all
ed 11 Jul 2012 07:59:59.0454 PM EDT (000001;043;1342050844) [vxi] EVENT: DocumentParser::FetchDocument(http://ec2-user@174.129.240.84:8999/spell.vxml)
Wed 11 Jul 2012 07:59:59.0454 PM EDT (000001;043;1342050844) [vxi] EVENT: Cache Hit: http://ec2-user@174.129.240.84:8999/spell.vxml
Wed 11 Jul 2012 07:59:59.0456 PM EDT (000001;043;1342050844) [rec] EVENT: Cache Hit: http://ec2-user@174.129.240.84:8999/spelling_grammar.php
Wed 11 Jul 2012 07:59:59.0458 PM EDT (000001;043;1342050844) [rec] ERROR: Error creating grammar
Code: Select all
<?php
header('Content-type: text/xml');
echo '<?xml version="1.0"?>';
?>
<grammar root="spelling" mode="voice">
<rule id="spelling">
<ruleref uri="builtin:grammar/alphanum?entries=http://<server:port>/word_list.txt"/>
</rule>
</grammar>
Mike
Re: Spell a word
Hi,
Would you be able to provide us with the code snippet you are using to generate this error? The following code that we are using works for us:
spelling_example.php:
spelling_grammar.php:
word_list.txt:
Hope this helps.
Regards,
Plum Support
Would you be able to provide us with the code snippet you are using to generate this error? The following code that we are using works for us:
spelling_example.php:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form>
<field>
<property name="sensitivity" value="0.2"/>
<property name="confidencelevel" value="0.75"/>
<grammar src="spelling_grammar.php" type="application/srgs+xml"/>
<prompt>Spell the word example.</prompt>
<filled>You spelled example correctly.</filled>
</field>
</form>
</vxml>
Code: Select all
<?php
header('Content-type: text/xml');
echo '<?xml version="1.0"?>';
?>
<grammar root="spelling" mode="voice">
<rule id="spelling">
<item>
<ruleref uri="builtin:grammar/alphanum?entries=http://myserver.com/code_examples/word_list.txt"/>
</item>
</rule>
</grammar>
Code: Select all
example
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Spell a word
Hi,
Sorry I finally realized what was wrong. I am using Tomcat and JSPs to serve up my vxml.
So I switched the php page to a JSP and everything is great.
Thanks so much for your help and sorry for the confusion
Mike
Sorry I finally realized what was wrong. I am using Tomcat and JSPs to serve up my vxml.
So I switched the php page to a JSP and everything is great.
Thanks so much for your help and sorry for the confusion
Mike
Re: Spell a word
Hi,
One last question you don't mind. I am trying to give a prompt if they spell the word incorrectly. So I have been trying
But doesnt seem to work correctly is there a way to do this?
Thanks!
One last question you don't mind. I am trying to give a prompt if they spell the word incorrectly. So I have been trying
Code: Select all
<vxml version="2.0">
<form>
<field name="word" type="alphanum">
<property name="sensitivity" value="0.2"/>
<property name="confidencelevel" value="0.75"/>
<grammar src="spelling_grammar.jsp" type="application/srgs+xml"/>
<prompt>Spell the word example.</prompt>
<filled>
<if conf="word===example">
<prompt>
You spelled example correctly.
</prompt>
<else/>
<prompt>
You have spelled example incorrectly
</prompt>
</if>
</filled>
</field>
</form>
</vxml>
Thanks!
Re: Spell a word
Hi Mike,
Your spelling_grammar.jsp will determine if the user has spelled the word correctly. There's no need to use another <if> tag to check. If the user spells incorrectly, a nomatch event will be thrown, and you can play your error message then. Here is an example:
For more information on error handling, please take a look at the VXML documentation: http://www.plumvoice.com/docs/dev/voicexml:tags:nomatch
Regards,
Plum Support
Your spelling_grammar.jsp will determine if the user has spelled the word correctly. There's no need to use another <if> tag to check. If the user spells incorrectly, a nomatch event will be thrown, and you can play your error message then. Here is an example:
Code: Select all
<vxml version="2.0">
<form>
<field name="word" type="alphanum">
<property name="sensitivity" value="0.2"/>
<property name="confidencelevel" value="0.75"/>
<grammar src="spelling_grammar.jsp" type="application/srgs+xml"/>
<prompt>Spell the word example.</prompt>
<filled>
<prompt>
You spelled example correctly.
</prompt>
</filled>
<nomatch>
You have spelled example incorrectly
</nomatch>
</field>
</form>
</vxml>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: Spell a word
Perfect! Thanks so much for all of your help!
Re: Spell a word
Hi,
Okay so if I spell example incorrectly it just keeps saying
"Sorry I didn't understand you"
Thanks
Mike
Okay so if I spell example incorrectly it just keeps saying
"Sorry I didn't understand you"
Thanks
Mike