[DGD] parse_string question

Felix A. Croes felix at dworkin.nl
Sun Dec 30 22:36:41 CET 2007


bart at wotf.org wrote:

>[...]
> At any rate, my first example can easily handle the following phrase and
> result in a correct interpretation in 2 different cases:
>
> phrase: open box
>
> This could be a verb + object or an adjective + object.
>
> If there is a closed box that could be opened, verb + object is very likely
> what the player meant, but if there is an open box, the second is very likely
> what the player intended. Obviously, in the second case there has to be
> another verb also, so it is possible to see if this was the correct parsing on
> hindsight at least.
>
> What I am looking at is a way to handle those, and make a guess at what the
> player intended. In the first example I gave, I can deal with that on-the-fly,
> ie, WHILE parsing. I see no way to do that when adding the verbs to the
> grammar, except for changing the grammar each time. This is because once I
> have a verb=/open/ in there and it is matched, then it won't be matched by
> anything else, hence I cannot use the alternative where it is an adjective.

You can have 'open' as an adjective too, of course.  Much nicer to
have the alternate parse trees represent alternate meanings directly.

Regards,
Dworkin



More information about the DGD mailing list