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

RE: private rules

From: <Teemu.Tingander@tecnomen.com>
Date: Sat, 21 Oct 2006 10:24:11 +0300
Message-ID: <765E13141262784F9323D033FCCF06A0014FD887@ESMAIL3.tecnomen.net>
To: <Anastasia.Petrova@bercut.com>, <www-voice@w3.org>


Little bit further in same chapter is stated that it is OK to declare grammar without root rule. But then referencing to that grammar with "implicit rule reference" is illegal and should result an error. More about this are in chapters 4.7 and 2.2. And even more about he usage via VoiceXML in VoiceXML 2.0 end of chapter explaining refrencing to external grammar.

Public and private rules define the rules visibility. Public rules can be referred outside of this grammar where as private rules are for this grammars internal use only. Since the rule is referred from grammar itself (root="x") the private rule may also be referred.

- Teemu

-----Original Message-----
From: www-voice-request@w3.org [mailto:www-voice-request@w3.org] On Behalf Of Petrova Anastasia
Sent: 20. lokakuuta 2006 16:08
To: Mihai Sucan; www-voice@w3.org
Subject: RE: private rules

But the SRGS tells:
Both the XML Form and ABNF Form permit the grammar header to optionally declare a single rule to be the root rule of the grammar. The rule declared as the root rule must be defined within the scope of the grammar. The rule declared as the root rule may be scoped as either public or private.

So it's not required to specify the root rule. And if I don't, which rules will work? Only public rules? Or none of the existing rules?

-----Original Message-----
From: Petrova Anastasia
Sent: Friday, October 20, 2006 16:58
To: 'Mihai Sucan'; www-voice@w3.org
Subject: RE: private rules

So you mean that root rule must always be defined? And only rules used in the root one can be matched? It is not enough to specify a public rule to make it work?

-----Original Message-----
From: Mihai Sucan [mailto:mihai.sucan@gmail.com]
Sent: Friday, October 20, 2006 15:53
To: Petrova Anastasia; www-voice@w3.org
Subject: Re: private rules

Le Fri, 20 Oct 2006 14:27:33 +0300, Petrova Anastasia <Anastasia.Petrova@bercut.com> a Êcrit:

> Hello. A private-scoped rule cannot be referenced in the rule 
> definitions of other grammars and in other non-grammar documents and 
> is directly accessible only within its containing grammar. But if I 
> have a private rule, and user says something matching this rule, will 
> this mean that e.g. a field is filled? Or only public rules can be 
> matched by user input?
> Best regards, Anastasia Petrova


Yes, a private-scoped rule cannot be referenced in the definition of other grammar rules, nor in non-grammar documents. It's only directly accessible within its containing grammar. Also, your VoiceXML <grammar /> element cannot use as a root a private rule.

However, a private rule which is not used will never match. The same applies to public rules.

So, given the following SRGS grammar:

root $whatever;

$pages = contact | services | portfolio;

$numbers = one | two | three;

$countries = romania | france | germany;

public $people = me | you | her;

public $whatever = $pages | $countries;

$numbers and $people will never match, even if the user says "one/two/three" or "me/you/her". This is because the root rule $whatever never makes use of $numbers nor $people rules.

ROBO Design - We bring you the future
Received on Saturday, 21 October 2006 07:24:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:39 UTC