Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<vxml version="2.1" xml:lang="es">
<form>
<field name="keyword">
<grammar type="application/srgs+xml" root="KEYWORDEN" mode="voice" xml:lang="en">
<rule id="KEYWORDEN" scope="public">
<tag>lang='en';</tag>
<one-of>
<item>baseball<tag>id='1';</tag></item>
<item>burrito<tag>id='4';</tag></item>
<item>llama<tag>id='5';</tag></item>
</one-of>
</rule>
</grammar>
<grammar type="application/srgs+xml" root="KEYWORDES" mode="voice" xml:lang="es">
<rule id="KEYWORDES" scope="public">
<tag>lang='es';</tag>
<one-of>
<item>manzana<tag>id='manzana';</tag></item>
<item>burrito<tag>id='burrito';</tag></item>
<item>llama<tag>id='llama';</tag></item>
<item>lámpara<tag>id='lámpara';</tag></item>
</one-of>
</rule>
</grammar>
<prompt>
diga la palabra clave.
</prompt>
<nomatch>
<log>nomatch</log>
<prompt>No entiendo.</prompt>
<clear/>
</nomatch>
<filled>
<log>match</log>
<log>lang: <value expr="keyword.lang"/></log>
<foreach item="result" array="application.lastresult$">
<log>confidence: <value expr="result.confidence"/></log>
<log>utterance: <value expr="result.utterance"/></log>
<log>interpretation: <value expr="result.interpretation"/></log>
</foreach>
<prompt>tu dijiste <value expr="keyword.id"/></prompt>
<clear/>
</filled>
</field>
</form>
</vxml>
Notice that there is a missing "}" on the "lámpara" interpretation line. The results of this are that lang:es is ignored.LOCAL: confidence: 0.79
LOCAL: utterance: lámpar
LOCAL: interpretation: {id:lámpara lang:es
LOCAL: confidence: 0.03
LOCAL: utterance: llama
LOCAL: interpretation: {id:5 lang:en}
Is there some way I should be escaping this text, or encoding it differently to get it to return the expected results?