<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: [MUD-Dev] Text Parsing --> <!--X-From-R13: "Rnivq Praargg" <qqgNqvfpjbeyq.vzntvanel.pbz> --> <!--X-Date: Wed, 2 Jun 1999 18:31:27 -0700 --> <!--X-Message-Id: 199906021703330169.058EBF73#discworld,imaginary.com --> <!--X-Content-Type: text/plain --> <!--X-Reference: Pine.LNX.4.04.9906021001330.11870-100000#fnord,io.com --> <!--X-Reference: 3755A465.760D2212@classic-games.com --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, Re: [MUD-Dev] Text Parsing</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:ddt#discworld,imaginary.com"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00413.html">Previous</a> | <a href="msg00415.html">Next</a> ] Thread: [ <a href="msg00410.html">Previous</a> | <a href="msg00401.html">Next</a> ] Index: [ <A HREF="author.html#00414">Author</A> | <A HREF="#00414">Date</A> | <A HREF="thread.html#00414">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>Re: [MUD-Dev] Text Parsing</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Subject</em>: Re: [MUD-Dev] Text Parsing</LI> <LI><em>From</em>: "David Bennett" <<A HREF="mailto:ddt#discworld,imaginary.com">ddt#discworld,imaginary.com</A>></LI> <LI><em>Date</em>: Wed, 02 Jun 1999 17:03:33 -0700</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> On 6/2/99, at 4:38 PM, Greg Miller wrote: >I prefer "get red and blue swords" and "get swords" for these cases. >They're plain english, less typing that anything suggested so far, and >they're likely among the first things new players will try. >Have you looked at the DiscWorld mudlib? I've found it saves me quite a >bit of typing, simply by interpreting short english sentences to mean >what they do in english rather than requiring odd constructs like "all >swords" or "all.sword" Since Discworld was mentioned... This parsing is mostly done using an efun that exists in most lpMud drivers, original used on Genesis I think (although I am not sure if they still do or not): 'parse_command' being the efun. It works by getting a list of adjectives, plurals and nouns off every object which is passed into the system (plus a list of adjectives etc which match for all object off the master object). It will parse a few default things, like numbers (one, two, three) and (first, second, third), then it then goes through this list, breaking up the input into words, and looking for the first match. The return from the efun is the list of *every* object that matched the description (short circuited on the first match), Discworld's wrapper then asks each object if it really wants to be included in the resultant array and returns this result. The parsing leads to some obvious problems: if you have something called 'longsword' and something called 'longsword scabbard' it will always match the longsword and not the scabbard. In terms of input I think one of the best things you can do is, first of all, be consistend and second be easy to use. The commands must be logical at some level or people will just forget them. Things like: sword 2, second sword and two swords all work in the discworld parser, which is really just a sophisticated wrapper to parse_command() at the object matching level. The way I ended up doing verbs was to use a system where each object still adds their verb, but they add a pattern for the verb too. Which means that the parser does a lot of the syntax checking level of the work for you. eg: add_command("fill", "<direct:object> from <indirect:object>"); This does lead to some problems and I think overall having a centrally controlled parser with a set of centrally defined patterns works a lot better and leads to less confusion for the player. May your days be long and frog filled, David. _______________________________________________ MUD-Dev maillist - MUD-Dev#kanga,nu <A HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A> </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00391" HREF="msg00391.html">Re: [MUD-Dev] Text Parsing</A></STRONG> <UL><LI><EM>From:</EM> "Travis S. Casey" <efindel#io,com></LI></UL></LI> <LI><STRONG><A NAME="00399" HREF="msg00399.html">Re: [MUD-Dev] Text Parsing</A></STRONG> <UL><LI><EM>From:</EM> Greg Miller <gmiller#classic-games,com></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00413.html">Re: [MUD-Dev] Languages (slightly offtopic, was Text Parsing)</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00415.html">Re: [MUD-Dev] Text Parsing</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00410.html">[MUD-Dev] Re[2]: [MUD-Dev] Text Parsing</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00401.html">Re: [MUD-Dev] Text Parsing</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00414"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00414"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><STRONG>Re: [MUD-Dev] Text Parsing</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <ul compact> <LI><strong><A NAME="00388" HREF="msg00388.html">Re: [MUD-Dev] Text Parsing</A></strong>, Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Wed 02 Jun 1999, 14:30 GMT <UL> <LI><strong><A NAME="00391" HREF="msg00391.html">Re: [MUD-Dev] Text Parsing</A></strong>, Travis S. Casey <a href="mailto:efindel#io,com">efindel#io,com</a>, Wed 02 Jun 1999, 15:31 GMT <UL> <LI><strong><A NAME="00399" HREF="msg00399.html">Re: [MUD-Dev] Text Parsing</A></strong>, Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Wed 02 Jun 1999, 23:24 GMT <UL> <LI><strong><A NAME="00410" HREF="msg00410.html">[MUD-Dev] Re[2]: [MUD-Dev] Text Parsing</A></strong>, Travis Casey <a href="mailto:efindel#io,com">efindel#io,com</a>, Thu 03 Jun 1999, 00:52 GMT </LI> <LI><strong><A NAME="00414" HREF="msg00414.html">Re: [MUD-Dev] Text Parsing</A></strong>, David Bennett <a href="mailto:ddt#discworld,imaginary.com">ddt#discworld,imaginary.com</a>, Thu 03 Jun 1999, 01:31 GMT </LI> </UL> </LI> </UL> </LI> </UL> </LI> <LI><strong><A NAME="00401" HREF="msg00401.html">Re: [MUD-Dev] Text Parsing</A></strong>, Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Wed 02 Jun 1999, 23:25 GMT </LI> <LI><strong><A NAME="00415" HREF="msg00415.html">Re: [MUD-Dev] Text Parsing</A></strong>, Kylotan <a href="mailto:kylotan#kylotan,force9.co.uk">kylotan#kylotan,force9.co.uk</a>, Thu 03 Jun 1999, 01:48 GMT </LI> </ul> <LI><strong><A NAME="00383" HREF="msg00383.html">Re: [MUD-Dev] Text Parsing</A></strong>, Travis S. Casey <a href="mailto:efindel#io,com">efindel#io,com</a>, Wed 02 Jun 1999, 12:50 GMT </LI> <LI><strong><A NAME="00387" HREF="msg00387.html">Re: [MUD-Dev] Text Parsing</A></strong>, Katrina McClelan <a href="mailto:kitkat#marcus,pants.nu">kitkat#marcus,pants.nu</a>, Wed 02 Jun 1999, 14:30 GMT </LI> </ul> </ul> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>