I'm trying to build a GVP application via Composer (Genesys Framework) that needs to accept an input through speech recognition. The input consist of an alphanumeric code of 12 or more letters/numbers where the speaker needs to use name of italian cities in place of letters.
I already tried to write a code for my grammar using the grammar builder in Genesys Composer but this way it only accept ONE word. So i started to write a .grxml code from scratch (I have basically no knowledge about this kind of language). I came up with the following:
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="it-IT" version="1.0"
root="codice">
<rule id="A" scope="public">
<item repeat="0-5">
<one-of>
<item>Ancona</item>
<item>A</item>
</one-of>
</item>
</rule>
<rule id="B" scope="public">
<item repeat="0-5">
<one-of>
<item>Bologna</item>
<item>Bari</item>
<item>Bi</item>
<item>B</item>
</one-of>
</item>
</rule>
<rule id="C" scope="public">
<item repeat="0-5">
<one-of>
<item>Como</item>
<item>Ci</item>
<item>C</item>
</one-of>
</item>
</rule>
<rule id="D" scope="public">
<item repeat="0-5">
<one-of>
<item>Domodossola</item>
<item>Di</item>
<item>D</item>
</one-of>
</item>
</rule>
<!-- Reference by URI to a local rule -->
<rule id="codice" scope="public">
<item repeat="0-5">
<ruleref uri="#A" />
<ruleref uri="#B" />
<ruleref uri="#C" />
<ruleref uri="#D" />
</item>
</rule>
</grammar>
The grammar works but only if I pronounce the words in order. For example if I pronounce "ANCONA, COMO" I got the right result and if I print my input variable it contains "ANCONA COMO". Instead, if I pronounce "COMO, ANCONA" my variable only contains the word "COMO". How can I "loop" through my rules in order to get words pronounced in random order? Thank you.
I think you should try something like this, but your case is complex. You can found specification here