W3C home > Mailing lists > Public > www-voice@w3.org > April to June 2002

please hep built-in grammar

From: yanyang fang <f_yanyang@hotmail.com>
Date: Wed, 15 May 2002 12:28:05 -0400 (EDT)
To: www-voice@w3.org
Message-ID: <F88uBeZVo2d3gwhDCvY0001bbaa@hotmail.com>

Hello everyone,

I am using JSGF grammar format to develop a grammar which allows user to 
transfer amount of money from one account to another account, the grammar I 
write so far only works “transfer from a account to another account”, it can 
not specify the amount of money as I am not able to add built in grammar 
such as “currency” into grammar file. The SDK I am using is IBM SDK 2.0, the 
error message says: “Unknown import builtin.grammar in fromtogrammar”. Can 
anybody help me to sort this problem? Thank you very much in advance for any 

Here is the code:

Grammar file:fromtogrammar.gram

#JSGF V1.0;

grammar fromtogrammar;

import <builtin.grammar.digits>;

public <fromto> =


public <fromaccount>= saving | current;

public <toaccount>= saving | current;

public <amount>=<digits>;

here is the file that use the grammar : transfer.vxml
<?xml version="1.0"?>

<vxml version="1.0">

<form id="accounttransfer">

<grammar src="fromtogrammar.gram" type="application/x-jsgf"/>

<initial name="start">

  <prompt> what accounts would you like to transfer from and to?</prompt>

  <help> you can say, for example, from current to saving account.


    <nomatch count="1"> I'm sorry, I don't understand.

        I will ask you for information one piece at a time.

    <assign name="start" expr="true"/></nomatch>


<field name="toaccount">

  <prompt>please state the account name to which you want to 

<grammar src="fromtogrammar.gram#toaccount"/>

   <catch event="nomatch"> sorry, please say your valide account 


   <if cond="toaccount==fromaccount">

      <clear namelist="toaccount"/>

      sorry, can not transfer between two same account, please try 




<field name="fromaccount">

  <prompt>please state the account name from which you want to 

<grammar src="fromtogrammar.gram#fromaccount"/>

<catch event="nomatch"> sorry, please say your valid account name</catch>


   <if cond="toaccount==fromaccount">

      <clear namelist="frmaccount"/>

      sorry, can not transfer between two same account, please try 




<field name="amount" type="digits">

<prompt>how much money you would like to transfer?</prompt>

  <help>for example, you can say or key in 100 pounds.</help>


<field name="go_ahead" type="boolean" modal="true">

  <prompt>Do you want to transfer <value expr="amount"/>from

    <value expr="fromaccount"/>to<value expr="toaccount"/>?



     <if cond="go_ahead">

        <prompt>thank you very much for your interesting</prompt>

      <!--<submit next="http://localhost:8080/servlet/bankservlet.transfer" 
namelist="fromaccount toaccount amount"/>-->


     <clear namelist="fromaccount toaccount start amount go_ahead"/>





Thanks a lot


Join the world’s largest e-mail service with MSN Hotmail. 
Received on Wednesday, 15 May 2002 17:46:10 UTC

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