[Home] [Groups] - Message: [Prev in Group] [Next in Group]
10260: [MUD-Dev] Re: Re: [MUD-Dev] Text Parsing
[Full Header] [Plain Text]
From: Albert <thecheezeman@earthlink.net>
Newsgroups: nu.kanga.list.mud-dev
Date: Mon, 31 May 1999 11:37:11 -0500
Organization: Kanga.Nu
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.
The parser would handle conjunctions a bit differently. Basically,
"get ball and stick" would be broken down into "get ball" and
"get stick".
Author: Albert Yi (TheCheeseMan) ICQ: 14617788
home.earthlink.net/~thecheezeman
_______________________________________________
MUD-Dev maillist - MUD-Dev@kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev