[DGD] parse_string question

bart at wotf.org bart at wotf.org
Sun Dec 30 22:32:04 CET 2007


On Sun, 30 Dec 2007 22:06:44 +0100, Felix A. Croes wrote
> bart at wotf.org wrote:
> 
> >[...]
> > I suppose that if this happens only every so often, it shouldn't be much of an
> > issue, but would it be if the list of verbs is determined just before parsing
> > the input, and as a result may change every time a new line of input is
parsed?
> 
> After every line of input?  That sounds very far away from having a
> global parser that always interprets input the same way, independent
> of the environment.  Are you planning to add a new verb each time a
> player mistypes a command?

No, and I don't plan on changing the list of verbs for every line of input,
but I do see that it could in theory happen in a worst case scenario, and am
considering how much of an issue that would be versus allowing for some level
of ambiguity.

Does environment play some role? well sure..

For one, it always does, since in the end your grammar is written for an
'environment', even if that environment is your entire game. Unless your
grammar contains basicly a complete webster or similar, it is a subset of a
language, both in words and grammar rules that is specifically tailered for
your environment.

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.

Bart
--
Created with Open WebMail at http://www.bartsplace.net/
Read my weblog at http://soapbox.bartsplace.net/




More information about the DGD mailing list