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:
- 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>
spelling_grammar.php would be the grammar you write using the builtin alphanum:
- 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>
word_list.txt is simply a text file with the word(s) you want your users to spell:
- Code: Select all
example
Regards,
Plum Support