The application nbest.vxml prompts the user to say a 6-digit number. Five n-best results are returned.
The following grammar, id.grxml, supports the application nbest.vxml shown below.
<?xml version="1.0" encoding="ISO-8859-1"?> <grammar version="1.0" xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" mode="voice" root="id" tag-format="semantics/1.0"> <rule id="id"> <item repeat="6"> <ruleref uri="#digit"/> </item> </rule> <rule id="digit"> <one-of> <item>0</item> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> </one-of> </rule> </grammar>
<?xml version="1.0" encoding="iso-8859-1"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-US"> <property name="maxnbest" value="5"/> <form> <field name="id"> <grammar type="application/srgs+xml" src="id.grxml"/> <prompt> Please say your 6 digit identification number.</prompt> <filled> <prompt> There are <value expr="application.lastresult$.length"/> results. </prompt> <if cond="application.lastresult$.length >= 1"> <prompt> <value expr="application.lastresult$[0].utterance"/> has score <value expr="application.lastresult$[0].confidence"/>. </prompt> </if> <if cond="application.lastresult$.length >= 2"> <prompt> <value expr="application.lastresult$[1].utterance"/> has score <value expr="application.lastresult$[1].confidence"/>. </prompt> </if> <if cond="application.lastresult$.length >= 3"> <prompt> <value expr="application.lastresult$[2].utterance"/> has score <value expr="application.lastresult$[2].confidence"/>. </prompt> </if> <if cond="application.lastresult$.length >= 4"> <prompt> <value expr="application.lastresult$[3].utterance"/> has score <value expr="application.lastresult$[3].confidence"/>. </prompt> </if> <if cond="application.lastresult$.length >= 5"> <prompt> <value expr="application.lastresult$[4].utterance"/> has score <value expr="application.lastresult$[4].confidence"/>. </prompt> </if> </filled> </field> </form> </vxml>