W3C home > Mailing lists > Public > www-voice@w3.org > October to December 2002

Re: multiple values returned

From: Yahn Teisseire <yahn@ukibi.com>
Date: Thu, 17 Oct 2002 11:48:29 +0200
Message-ID: <0b3201c275c2$59181190$e9020a0a@paris.ukibi.com>
To: "Matthew Henry" <mhenry@voxeo.com>, <www-voice@w3.org>
Ok it works very fine, thanks a lot.

Yahn Teisseire
  ----- Original Message ----- 
  From: Matthew Henry 
  To: Yahn Teisseire ; www-voice@w3.org 
  Sent: Wednesday, October 16, 2002 11:27 PM
  Subject: Re: multiple values returned


  Check out the below code sample, which should illustrate the changes that you will need to make to your existing subgrammar structure. Let me know if I can offer any further help, and I would be happy to do so.


  Matthew Henry
  Voxeo Community Support

  Bring your web applications to the phone.
  Find out how at http://community.voxeo.com

  ===MyMultiSlotSub.gsl ===

  <choice "filled">
  <hun_literal $a.literal> <hun_numeric $a.numeric>
  <denom_literal $b.literal> <denom_numeric $b.numeric>
  <country_literal $c.literal> <country_numeric $c.numeric>

  (one hundred)  {return ([<literal "one hundred"> <numeric "100">]) }
  (two hundred)  {return ([<literal "two hundred"> <numeric "200">]) }
  (three hundred)  {return ([<literal "three hundred"> <numeric "300">]) }

  (dollars)  {return ([<literal "dollars"> <numeric "usd">])}
  (deutchmarks)  {return ([<literal "deutchmarks"> <numeric "dm">])}
  (drakmas)  {return ([<literal "drakmas"> <numeric "ds">])}

  (united states) {return ([<literal "united states"> <numeric "usa">])}
  (germany) {return ([<literal "germany"> <numeric "gm">])}
  (greece) {return ([<literal "greece"> <numeric "gc">])}

  === ===
  <?xml version="1.0"?>
  <!DOCTYPE vxml PUBLIC '-//Nuance/DTD VoiceXML 1.0//EN' 
  'http://dtd.voxeo.net/dtd/voicexml-nuance-1_2.dtd' >
    <vxml version="2.0">  
      <form id="MyForm">
        <field name="MyField" slot="choice"> 
          <grammar src="MyMultiSlotSub.gsl#MYRULE"/>
            how much money?

                enter an amount in hundreds, currency type, and country, such as
                one hundred dollars, united states.

              You said <value expr="lastResult$.interpretation.hun_literal"/> for the literal amount value, and 
                <value expr="lastResult$.interpretation.hun_numeric"/> for the numeric amount value and
                <break size="medium"/>

                <value expr="lastResult$.interpretation.denom_literal"/> for denomination literal
                <value expr="lastResult$.interpretation.denom_numeric"/> for denomination numeric

                <break size="medium"/>

                <value expr="lastResult$.interpretation.country_literal"/> for country literal
                <value expr="lastResult$.interpretation.country_numeric"/> for country numeric


    ----- Original Message ----- 
    From: Yahn Teisseire 
    To: www-voice@w3.org 
    Sent: Wednesday, October 16, 2002 8:42 AM
    Subject: multiple values returned


    I have the following grammar :

    Finalgrammar [
             (Action:a ?Name:n ?Media:m)  {<action $a><contact $n><media $m>}

    Action [
               call { return ("call")}
               find { return ("find")}
               spell { return ("spell")}

    Name [
                   [john doe (john doe) johny] {return([<contactname "john doe"><contactid "1234">])}

    Media [
                   home { return ("home")}
                   mobile { return ("mobile")}
                   work { return ("work")}

    This grammar works, but i'm unable to access "contactname" and "contactid" :
    application.lastresult$[0].interpretation.action returns "call" for example,
    application.lastresult$[0].interpretation.contact returns { contactname = "john doe" contactid = "1234" },
    but application.lastresult$[0].interpretation.contact.contactname returns "undefined".

    How could i do ?

Received on Thursday, 17 October 2002 05:48:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:03:47 UTC