VXML Code:
Code: Select all
<!-- Working Routines are in this form" -->
<form id="basic_grammar_main" scope="document">
<grammar version="1.0"
xml:lang="en-US"
mode="voice"
src= "test_grammar.grxml"
root="inventory"
scope="document"
type="application/srgs+xml" />
<block>
<if cond="resultstring == '' ">
Please list the inventory types of bolts and nuts you are interested in searching or say ALL
</if>
</block>
<initial name="inventory" />
<!-- .............................. INPUT "FIELDS" BLOCK ................................ -->
<!-- FIELD INPUT - ALL types -->
<field name="all" />
<filled namelist="all" >
<if cond="all == 'all' ">
<if cond="all_ctr == faux " >
<assign name="all" expr="all = 'all' " />
<assign name="resultstring" expr="resultstring = 'bolts,nuts' " />
<assign name="all_ctr" expr="all_ctr = veritas" />
<goto next="#dummy_exit" />
</if>
</if>
</filled>
<!-- FIELD INPUT - Bolts -->
<field name="bolts" >
<prompt> Which type of bolts ? </prompt>
</field>
<filled namelist="bolt" >
<if cond="bolts == 'bolts' ">
<if cond="bolts_ctr == faux " >
<assign name="bolts" expr="bolt = 'bolts' " />
<assign name="bolts_ctr" expr="bolts_ctr = veritas" />
<assign name="resultstring" expr="resultstring = bolts + ',' " />
</if>
</if>
</filled>
<!-- FIELD INPUT - Hex Nuts -->
<field name="nuts" slot="nuts" >
<prompt> Which type of nuts ? </prompt>
</field>
<filled namelist="nuts" >
<if cond="nuts == 'nuts' ">
<if cond="nuts_ctr == faux " >
<assign name="nuts" expr="nuts = 'nuts' " />
<assign name="resultstring" expr="resultstring = resultstring + ',' + nuts" />
<assign name="nuts_ctr" expr="nuts_ctr = veritas" />
</if>
</if>
</filled>
</form>
Code: Select all
<!-- GRAMMAR COMPONENTS FOLLOW .... -->
<!-- Ruleref to utilize the grammar components -->
<rule id = "inventory" scope="public" >
<item repeat = "1-3">
<one-of>
<item><ruleref uri="#all"/></item>
<item><ruleref uri="#bolts"/></item>
<item><ruleref uri="#nuts"/></item>
</one-of>
</item>
</rule>
<!-- Word = "all" and alternatives -->
<rule id="all" scope="public" >
<item>
<tag>all="all"</tag>
<one-of>
<item xml:lang="en-US" >all</item>
<item xml:lang="en-US" >everything</item>
<item xml:lang="en-US" >all of them</item>
</one-of>
</item>
</rule>
<!-- Word = "bolts" and alternatives -->
<rule id="bolts" scope="public" >
<item>
<tag>bolts="bolts"</tag>
<one-of>
<item xml:lang="en-US" >bolts</item>
<item xml:lang="en-US" >machine screws</item>
<item xml:lang="en-US" >carriage bolts</item>
</one-of>
</item>
</rule>
<!-- Word = "nuts" and alternatives -->
<rule id="nuts" scope="public" >
<item>
<tag>nuts="nuts"</tag>
<one-of>
<item xml:lang="en-US" >nuts</item>
<item xml:lang="en-US" >course hex nuts</item>
<item xml:lang="en-US" >self locking nuts</item>
</one-of>
</item>
</rule>
- Finished loading remote grammar from test_grammar.grxml
VXI::var_element(name="veritas" expr = "")
VXI::var_element(name="faux" expr = "")
VXI::var_element(name="undef" expr = "")
VXI::var_element(name="expression" expr = "")
VXI::var_element(name="nav2" expr = "")
VXI::var_element(name="resultstring" expr = "")
VXI::var_element(name="all_ctr" expr = "")
VXI::var_element(name="bolts_ctr" expr = "")
VXI::var_element(name="nut_ctr" expr = "")
VXI::assign_element(name="veritas" expr = "1==1"
VXI::assign_element(name="faux" expr = "1==0"
VXI::assign_element(name="nav2" expr = "' '"
VXI::assign_element(name="resultstring" expr = " '' "
VXI::assign_element(name="all_ctr " expr = "faux"
VXI::assign_element(name="bolts_ctr " expr = "faux"
VXI::assign_element(name="nut_ctr " expr = "faux"
bargein set to true
INPUTMODES set to "VOICE"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
Please list the inventory types of bolts and nuts you are interested in searching or say ALL
---------
VXI::queue_prompts()
VXI::field_element - activating grammars for form = 'basic_grammar_main' formitem = 'inventory'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Mon 20 Mar 2006 09:01:10 PM EST:
Found grammar match
hypothesis #0: machine screws course hex nuts (0.4100)
hypothesis #1: machine screws nuts (0.0280)
Saved utterance 0 for DNIS 3785 on channel 2
received event: nomatch
bargein set to true
INPUTMODES set to "VOICE"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
Sorry, I didn't understand you.
---------
VXI::queue_prompts()
VXI::field_element - activating grammars for form = 'basic_grammar_main' formitem = 'inventory'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Mon 20 Mar 2006 09:01:16 PM EST:
received event: noinput
VXI::queue_prompts()
VXI::field_element - activating grammars for form = 'basic_grammar_main' formitem = 'inventory'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Mon 20 Mar 2006 09:01:21 PM EST:
Found grammar match
hypothesis #0: nuts (0.7430)
hypothesis #1: all nuts (0.0300)
Saved utterance 1 for DNIS 3785 on channel 2
received event: nomatch
bargein set to true
INPUTMODES set to "VOICE"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
I still don't understand.
---------
VXI::queue_prompts()
VXI::field_element - activating grammars for form = 'basic_grammar_main' formitem = 'inventory'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Mon 20 Mar 2006 09:01:27 PM EST:
Saved utterance 2 for DNIS 3785 on channel 2
received event: nomatch
bargein set to true
INPUTMODES set to "VOICE"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
Please say it one last time.
---------
VXI::queue_prompts()
VXI::field_element - activating grammars for form = 'basic_grammar_main' formitem = 'inventory'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Mon 20 Mar 2006 09:01:32 PM EST:
Saved utterance 3 for DNIS 3785 on channel 2
received event: connection.disconnect.hangup
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 2
plumvp::ChannelThread: Channel 2: Call Terminated
New session ID 000000;002;1142906492 for Channel 2
plumvp::ChannelThread: Channel 2: Enabling Call 651
Enabling Calls For Channel 2
plumvp::ChannelThread: About to call VXIplatformWaitForCall
Waiting For Calls on Channel 2