[DGD] Re: parse_string() and ambiguity

Felix A. Croes felix at dworkin.nl
Fri Oct 24 23:51:04 CEST 2003


"S. Foley" <zeppo1 at mindspring.com> wrote:

> Consider the string input to parse string 'I run' and the same lame grammar:
>
> SENTENCE : SUBJECT PREDICATE  /* rule 1*/
> SUBJECT : word                                    /* rule 2*/
> PREDICATE : word                               /* rule 3*/
>
> 'I run' is tokenized to ({ word, word }) which can be arrived at first by
> application of rule #1, then #2, and then #3, or via application of #1, #3,
> and then #2.  The bottom line is that the difference in order of application
> isn't relevant?

It isn't relevant because the parse tree is the same in both cases.  The
first word is a SUBJECT and the same word is a PREDICATE.  Don't look at
the "application order"; only look at the resulting parse tree.

Regards,
Dworkin
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list