<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD-Dev] string parsing -->
<!--X-From-R13: @nguna Kbfcr <lbfcrNunjnvv.rqh> -->
<!--X-Date: Thu, 30 Oct 1997 21:34:59 +0000 -->
<!--X-Message-Id: Pine.GSO.3.95q.971030100535.3372A-100000@uhunix2 -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199710301757.SAA26781#xs1,simplex.nl -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] string parsing</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:yospe#hawaii,edu">
</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="msg00177.html">Previous</a>
| <a href="msg00179.html">Next</a>
]
Thread:
[ <a href="msg00176.html">Previous</a>
| <a href="msg00191.html">Next</a>
]
Index:
[ <A HREF="author.html#00178">Author</A>
| <A HREF="#00178">Date</A>
| <A HREF="thread.html#00178">Thread</A>
]
<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] string parsing</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] string parsing</LI>
<LI><em>From</em>: Nathan Yospe <<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>></LI>
<LI><em>Date</em>: Thu, 30 Oct 1997 11:36:41 -1000</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Thu, 30 Oct 1997, Felix A. Croes wrote:
:If you want to avoid information loss, you can let the function return
:an array, the first element of which is the original subtree, and the
:second element being the meaning that the function gives to that subtree.
:You can also use alternative grammar rules to catch user errors, for
:instance:
: GiveCommand: 'give' Object 'to' Living ? do_give
: GiveCommand: 'give' Object 'to' ZeroOrMoreWords ? give_to_whom
: GiveCommand: 'give' Object ? give_to_whom
: GiveCommand: 'give' ZeroOrMoreWords ? give_what
:The part that I didn't specify, of course, is which of these
:production rules is eventually picked: a valid give command
:matches all of them. My options seem to be to either select
:the first matching one, or to sort the resulting parse trees
:by the order of the production rules that were used to generate
:them (resulting in the "most valid" parsing being first). I
:am still undecided about this.
I've written quite a bit on this topic in the past. While my current
parsers are in Java, and the rules of the lexical system are a little
different, there are similarities... I have finally implemented sentance
completion. As soon as there is a possible completion, the completed
sentance is printed in gray text ghosted off of the typed text. Hitting
tab completes a current gray segment, hitting enter submits black only.
Sentance parse:
Give Black Bart a kick in the head.
Give Rose the rose.
Give Rose a kiss.
Give Rose to Danny.
Lightly give Rose a pat on the head. -\
Give Rose a light pat on her head. +- evaluate identically
Give Rose a pat on the head lightly. -/
Give thanks.
Five verbs match "give".
give - [subject] [noun]
give - [noun] to [subject]
give - [subject] [verb2] {othertext}
give - [subject] [verbnoun] {othertext}
give - [matching qualifier]
Where adjectives and qualifiers are considered part of the noun.
For the first one, we get:
g[rin.]
gi[ve...] <t>
give bla[ze...]
give blac[k Bart...] <t>
give Black Bart a ki[ss.]
give Black Bart a kic[k.]
give Black Bart a kick i[n the nards.]
Give Black Bart a kick in the head.
For the second:
g[rin.]
gi[ve...] <t>
give ro[se...] <t>
give Rose a ro[se.] <t>
Give Rose a rose.
For the third:
g[ive...] <t> //assuming prediction weight on give now exceeds grin
give ro[se...] <t>
give Rose a ki[ck.]
give Rose a kis[anderian helm.]
give Rose a kiss[.]
Give Rose a kiss. // => Kiss Rose.
For the fourth:
g[ive] <t>
give ro[se...] <t>
give Rose t
give rose to
give
give Rose to da[nny.]
Give Rose to Danny.
What actually happens?
The five "give" verbs are each performing a seperate weighting of the input
as it comes in. The one that evaluates the input the most sucessfully gets
chosen. In the case of a tie, the higher version of the verb (ie: give
subject noun) gets evaluated. Recent actions get a higher weighting.
--
"You? We can't take you," said the Dean, glaring at the Librarian.
"You don't know a thing about guerilla warfare." - Reaper Man,
Nathan F. Yospe Registered Looney by Terry Pratchett
yospe#hawaii,edu <A HREF="http://www2.hawaii.edu/~yospe">http://www2.hawaii.edu/~yospe</A> Meow
</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="00176" HREF="msg00176.html">Re: [MUD-Dev] string parsing</A></STRONG>
<UL><LI><EM>From:</EM> "Felix A. Croes" <felix#xs1,simplex.nl></LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00177.html">Re: [MUD-Dev] string parsing</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00179.html">Re: [MUD-Dev] Re: Idea: Hive-mind monster</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00176.html">Re: [MUD-Dev] string parsing</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00191.html">Re: [MUD-Dev] string parsing</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00178"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00178"><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] string parsing</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00282" HREF="msg00282.html">Re: [MUD-Dev] string parsing</A></strong>,
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Thu 13 Nov 1997, 03:07 GMT
<UL>
<LI><strong><A NAME="00284" HREF="msg00284.html">Re: [MUD-Dev] string parsing</A></strong>,
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 13 Nov 1997, 04:24 GMT
</LI>
<LI><strong><A NAME="00292" HREF="msg00292.html">Re: [MUD-Dev] string parsing</A></strong>,
Adam Wiggins <a href="mailto:nightfall#user2,inficad.com">nightfall#user2,inficad.com</a>, Fri 14 Nov 1997, 08:48 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00176" HREF="msg00176.html">Re: [MUD-Dev] string parsing</A></strong>,
Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Thu 30 Oct 1997, 17:58 GMT
<UL>
<LI><strong><A NAME="00178" HREF="msg00178.html">Re: [MUD-Dev] string parsing</A></strong>,
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Thu 30 Oct 1997, 21:34 GMT
</LI>
</UL>
<UL>
<li><Possible follow-up(s)><br>
<LI><strong><A NAME="00191" HREF="msg00191.html">Re: [MUD-Dev] string parsing</A></strong>,
Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Fri 31 Oct 1997, 12:02 GMT
<UL>
<LI><strong><A NAME="00195" HREF="msg00195.html">Re: [MUD-Dev] string parsing</A></strong>,
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Fri 31 Oct 1997, 20:54 GMT
</LI>
<LI><strong><A NAME="00213" HREF="msg00213.html">Re: [MUD-Dev] string parsing</A></strong>,
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sun 02 Nov 1997, 20:59 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00173" HREF="msg00173.html">Re: [MUD-Dev] string parsing</A></strong>,
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 30 Oct 1997, 09:32 GMT
</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>