[MUD-Dev] Re: Prepositions and parsing

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Sat May 10 09:28:14 CEST 1997


[Chris L:]
:How about, "beside", "behind", "above", "between", "near", "close to",
:"over" etc?  I'm specifically looking for intelligent handling that
:will allow the following sequence:
:
:  > put the book on the table
:  OK.
:  > put the paper under the book
:  OK.
:  > l
:  There is a table here with a book on it.
:  > get book
:  OK.
:  > l
:  There is a table here with a paper on it.

It strikes me (after very little thought!) that the semantics is harder
than the syntax. You have to implement some kind of concept of objects
which are so small and flat that they can be put under other objects,
thus being hidden, but not harmed. That's a fairly special-case set of
objects, and if you are doing that, then you'll likely have a whole mess
of other kinds of objects. By the time you have set up the semantics for
all of that, the parsing might look easy!

To handle the above stuff, you don't even need to have prepositional
phrases attached to objects. In terms of my parser, you just have a
couple of variants of 'put', one with a "separator word" of 'on', and
the other with 'under'. Those would automatically trigger the verb
handlers:

    putOn("book", "table");
    putUnder("paper", "book");

With this technique you do have to duplicate all verbs that can meaningfully
accept such prepositions, but how many is that? Of course, in the above
example, you would want to be able to "get the paper under the book", in
which case you now do need prepositional phrases as part of noun stuff.
It doesn't make a lot of sense to have a "get <np> under <np>" verb
(a "get under <np>" does make sense), so here the 'under' would have to
start a prepositional phrase. That would have to be available to the
verb handling code, in order to direct the search for the object. So,
perhaps the answer is that a "separator word" on a verb takes precedence
over prepositions. So, in "put the book behind the pillar", we would
trigger the "putBehind" verb, rather than go looking for a book behind
the pillar. Hmm. Does this only work for my parsing scheme where the
verbs identify the objects? If you have to identify the objects before
you can find the verbs, then the problem is harder - sort of a chicken
and egg thing.

Another aspect of these phrases is that they don't always indicate where
to look for the object, but sometimes just provide more description of
the objects. If a camera takes a picture of a book, then you have
"a photograph of a book".

--
Chris Gray   cg at ami-cg.GraySage.Edmonton.AB.CA



More information about the mud-dev-archive mailing list