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

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

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

Re: Spell a word

Post by support »

Hi Mike,

Yes, that is correct. However, if you want to reprompt the user again to spell the word, example, you can use the <reprompt> tag, mentioned in our documentation here: http://www.plumvoice.com/docs/dev/voice ... s:reprompt

Regards,
Plum Support

goochalba
Posts: 18
Joined: Wed Jun 13, 2012 9:01 pm

Re: Spell a word

Post by goochalba »

Is there anyway to capture the event of it being spelled incorrectly?

Thus if the spell it wrong give a message

"You have spelled it wrong"

Thanks!

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

Re: Spell a word

Post by support »

Hi Mike,

Yes, as mentioned in a previous post, you can do this with the <nomatch> tag:

spellingexample.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form>
  <field name="spellit">
    <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>
      <prompt>
        You spelled example correctly.
      </prompt>
    </filled>
      <nomatch>
        You have spelled it wrong. Please try again.
        <reprompt/>
      </nomatch>
  </field>
</form>
</vxml>
spelling_grammar.php:

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://oliver.plumgroup.com/~victor/word_list.txt"/>
    </item>
  </rule>
</grammar>
word_list.txt:

Code: Select all

example
Hope this helps.

Regards,
Plum Support

goochalba
Posts: 18
Joined: Wed Jun 13, 2012 9:01 pm

Re: Spell a word

Post by goochalba »

Hi,

Okay the issue was I was missing the inner prompt

Code: Select all

    
   <filled>
        You spelled example correctly.
    </filled>
And that was causing it to never understand what I was saying unless it was correct.

One last question it is not possible to capture the incorrect spelling correct?
i.e. if I spell example as "exampel" there is no way for me to capture that right?

Thanks again

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

Re: Spell a word

Post by support »

Hi,

That's correct, there is no way for you to capture the incorrect spelling.

Regards,
Plum Support

Post Reply