[DGD] Working with parse_string()

Felix A. Croes felix at dworkin.nl
Mon Jul 20 23:40:45 CEST 2009


Kamil N <kamiln at gmail.com> wrote:

> -----------parse_selector:  - ({ "heavy", "steel" })
> searching in inventory - ({ ({ "accusative", 1 }), "heavy", "steel" })
> NOT FOUND:  - ({ "heavy", "steel" })
>
> You can see that first it does parse for OBJI and finds it, then it
> searches for LIV and can't find it but suddenly it again searches for
> "heavy" and "steel" as if it hasn't found it already. Is it normal
> behaviour or I messed something really badly? Maybe my grammar rules
> are incorrect or I return wrong values in LPC functions that cause
> this.

This is normal.  The parser is trying to match the entire sentence,
and if the last two words don't describe a valid LIV_DAT, it will try
again with the last 3 words, thus leaving the first two for OBJI_ACC.


> Is it possible for single rule "verb: 'give' OBJI_ACC LIV_DAT" to
> first look for OBJI_ACC, then for LIV_DAT and then again OBJI_ACC?

Yes.

Regards,
Felix Croes



More information about the DGD mailing list