[MUD-Dev] Re: Re: [MUD-Dev] Text Parsing
Travis Casey
efindel at io.com
Mon May 31 22:25:58 CEST 1999
On Monday, May 31, 1999, Albert wrote:
> At 5/30/99 11:39:00 PM, you wrote:
>>On Friday, May 28, 1999, Albert wrote:
> <snip introduction>
>>For a parser that I was developing, I used patterns. I developed it
>>to the point where there was a function for "trying" an input string
>>against a particular pattern, which would return an empty array if the
>>pattern was not matched, or an array filled with the matches for the
>>variable parts of the pattern if it was matched. It did as much
>>processing as possible -- for example, the string:
> Hehe, that's what I ended up doing, resorting to patterns and having
> the parser try each of them out. Only my patterns are the following:
> verb + direct object (i.e. get ball)
> verb + indirect object (i.e. kill him)
> verb + direct object + indirect object (i.e. give ball to him)
> verb + indirect object + direct object (i.e. give him the ball)
> verb + string (i.e. say 'hello everybody')
> I believe all possible commands are simple variations of the above
> mentioned patterns. Conjunctions merely compound the patterns.
There is another common object: the prepositional object. E.g., in
put the ball on the table
"the table" is a prepositional object.
In practice, you can treat this as an indirect object, but
linguistically, it's not.
It should also be noted that changing the preposition in your third
case can result in a change from the indirect to the prepositional
object (or vice-versa), and will often result in a change in meaning.
get the ball to joe
get the ball for joe
get the ball from joe
all mean different things. (Note that of these, only the second can
be considered an indirect object, because it has the same meaning as
"get joe the ball".)
This is why I settled on using patterns the way I did -- to make these
sorts of distinctions easy to handle.
(From a very technical point of view, you can argue that the indirect
object *never* occurs with a preposition -- that only sentences of the
form "verb io do" have an indirect object, and all the others have
prepositional objects. In this case, there's a particular preposition
which can be used to match the meaning of the indirect object for that
verb -- but it can vary from verb to verb. Note that
give joe the ball means give the ball to joe
but
get joe the ball does not mean get the ball to joe)
For extra fun, note that synonyms can get very complicated... most
muds treat "get" and "take" as being the same, which they often are --
but "get the ball from joe" and "take the ball from joe" are not the
same! Further, note that "get the ball under joe" can mean "retrieve
the ball that joe is on top of" or it can mean "find a way to put the
ball under joe"!
--
|\ _,,,---,,_ Travis S. Casey <efindel at io.com>
ZZzz /,`.-'`' -. ;-;;,_ No one agrees with me. Not even me.
|,4- ) )-,_..;\ ( `'-'
'---''(_/--' `-'\_)
_______________________________________________
MUD-Dev maillist - MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list