msg00377.html
1999Q2/msg00377.html · 9.2 KB
From the archive 1999Q2.zip
Download the archive « Back to the archive contents
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD-Dev] Text Parsing -->
<!--X-From-R13: Quevf Uenl <ptNnzv-pt.UenlEntr.Sqzbagba.OP.QO> -->
<!--X-Date: Tue, 1 Jun 1999 23:03:31 -0700 -->
<!--X-Message-Id: 199906020601.AAA00965@ami-cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text/plain -->
<!--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:cg#ami-cg,GraySage.Edmonton.AB.CA">
</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="msg00376.html">Previous</a>
| <a href="msg00378.html">Next</a>
]
Thread:
[ <a href="msg00396.html">Previous</a>
| <a href="msg00378.html">Next</a>
]
Index:
[ <A HREF="author.html#00377">Author</A>
| <A HREF="#00377">Date</A>
| <A HREF="thread.html#00377">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>: Chris Gray <<A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A>></LI>
<LI><em>Date</em>: Wed, 2 Jun 1999 00:01:18 -0600</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>
[Ross Nicoll:]
> > take cookie then eat cookie
>
> My MUD would fall over at this. It was never hold how to deal with "then".
> Simplest method seems to be to split commands up around "then".
Agreed. I've just never bothered to do it. Mine breaks multiple commands
around '.', ';' or '!', and that's been good enough for me.
> > take cup and saucer and spoon
>
> or
>
> > take cup, saucer and spoon
>
> in which case, we have to make sure that the program doesn't start trying
> to find "cup," in the room.
Yep. Treat them as indentical. If the user insists on typing
take cup and saucer, spoon
I don't much care - it'll work. Why add code to prevent it?
> > take off coat
>
> seems simple enough. Thing is, do you first check for an object that can
> be described as an "off coat", or first check through the list of possible
> arguments to "take" for a match? The first options starts adding reserved
> words ("off button" anyone?), the second one has problems with other
> syntaxes:
>
> > take small box from wooden table
Ah, but the save here is that in your first case, 'off' is only a special
word when used with the 'take' verb. Similarly, 'from' is special for
this use of 'take'. The way I do it is to have, for each verb, a list
of the syntax forms for that verb. Only a simple no-indirect-object
form of a verb is allowed to not specify a preposition. Only one use
of a given preposition is allowed for a given verb. So, the prepositions
allow the parser to decide which verb form it is. The form says whether
or not it allows an indirect object, and if not, the preposition can be
either before or after the direct object. So:
check for special leading characters (", ', :, etc.) => special code
identify first word - its the verb
look up verb in active grammar. Cases:
if is "tail" verb pass rest of command (upto . or ; or !) to verb code
else
starting with word after verb, try to grab a noun phrase.
Phrase ends at end of command or at any preposition for any
form of the verb. If preposition is found, use that form of
the verb (requiring direct/indirect as indicated by form),
else the verb must have a simple form that requires no objects,
or just direct objects - pick whichever one you find. The
system disallows having both forms without prepositions.
> > take gold ring from the small box from wooden table
>
> but quite frankly, anyone typing that in deserves everything they get.
Yep. As indicated by the fact that it took *me* a second or so to
figure it out!
> Although 4 might be a lot simpler if the function was just called once for
> each item in a list.
That's what I do. That way the function just accepts one or two strings
for the noun phrases, rather than having to possibly accept a list of
them. I abort processing the list if the verb code says to.
--
Don't design inefficiency in - it'll happen in the implementation.
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA
<A HREF="http://www.GraySage.Edmonton.AB.CA/cg/">http://www.GraySage.Edmonton.AB.CA/cg/</A>
_______________________________________________
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>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00387" HREF="msg00387.html">Re: [MUD-Dev] Text Parsing</A></strong>
<ul compact><li><em>From:</em> Katrina McClelan <kitkat#marcus,pants.nu></li></ul>
<li><strong><A NAME="00383" HREF="msg00383.html">Re: [MUD-Dev] Text Parsing</A></strong>
<ul compact><li><em>From:</em> "Travis S. Casey" <efindel#io,com></li></ul>
<li><strong><A NAME="00378" HREF="msg00378.html">Re: [MUD-Dev] Text Parsing</A></strong>
<ul compact><li><em>From:</em> Ben Greear <greear#cyberhighway,net></li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00376.html">Re: [MUD-Dev] Text Parsing</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00378.html">Re: [MUD-Dev] Text Parsing</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00396.html">[MUD-Dev] What about goal oriented interfaces? (was Re: [MUD-Dev] Text Parsing)</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00378.html">Re: [MUD-Dev] Text Parsing</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00377"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00377"><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="00371" HREF="msg00371.html">Re: [MUD-Dev] Text Parsing</A></strong>,
Marc Hernandez <a href="mailto:marc#ias,jb.com">marc#ias,jb.com</a>, Tue 01 Jun 1999, 06:24 GMT
</LI>
</ul>
</ul>
<LI><strong><A NAME="00375" HREF="msg00375.html">Re: [MUD-Dev] Text Parsing</A></strong>,
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 02 Jun 1999, 01:38 GMT
<UL>
<LI><strong><A NAME="00376" HREF="msg00376.html">Re: [MUD-Dev] Text Parsing</A></strong>,
Ross Nicoll <a href="mailto:rnicoll#lostics,demon.co.uk">rnicoll#lostics,demon.co.uk</a>, Wed 02 Jun 1999, 03:49 GMT
</LI>
<LI><strong><A NAME="00396" HREF="msg00396.html">[MUD-Dev] What about goal oriented interfaces? (was Re: [MUD-Dev] Text Parsing)</A></strong>,
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Wed 02 Jun 1999, 23:08 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00377" HREF="msg00377.html">Re: [MUD-Dev] Text Parsing</A></strong>,
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 02 Jun 1999, 06:03 GMT
<UL>
<LI><strong><A NAME="00378" HREF="msg00378.html">Re: [MUD-Dev] Text Parsing</A></strong>,
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Wed 02 Jun 1999, 06:31 GMT
<UL>
<LI><strong><A NAME="00384" HREF="msg00384.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:57 GMT
<UL>
<LI><strong><A NAME="00398" HREF="msg00398.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
</LI>
</UL>
</LI>
<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
</LI>
</UL>
</LI>
</UL>
</LI>
</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>