Message-ID: <3ADC3BA9.65ACF390@csi.com>
Date: Tue, 17 Apr 2001 08:48:41 -0400
From: John Colagioia <JColagioia@csi.com>
Organization: No Conspiracy Here...
X-Mailer: Mozilla 4.77 [en] (Win98; U)
X-Accept-Language: en,fr,ru,es,it,ga,de,ja,gd,eu
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Parser: Resolving ambiguous multi-word objects
References: <9bf7b3$38g$06$4@news.t-online.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.34.37.104
X-Original-NNTP-Posting-Host: 208.34.37.104
X-Trace: excalibur.gbmtech.net 987511707 208.34.37.104 (17 Apr 2001 08:48:27 EST)
Lines: 43
X-Authenticated-User: jnc
X-Original-NNTP-Posting-Host: 127.0.0.1
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!feed2.onemain.com!feed1.onemain.com!uunet!dca.uu.net!nyc.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:85754

"Michael A. Krehan" wrote:

> Am I completely off the track here? Does nobody else have this problem? That
> 'decorative' flag does sound like a good idea to me, and since there's still
> some unused vocabulary flags left, this idea can actually be executed - it
> however requires changes to both the compiler and parser library.

Well, outside of Platypus and TADS, I don't believe you'll find adjectives, per
se.  However, you can build this into a basic Inform object using (as you
guessed) parse_name.  Check out:
    http://www.eblong.com/zarf/inftricks/tip_parsename.html (Thanks, once again,
to Mr. Plotkin!)
Something like the following should work right:
    parse_name [ wd num nameflag ;
     wd = NextWord();
     while (WordInProperty(wd, self, name) || WordInProperty(wd, self,
adjective)) {
       if (WordInProperty(wd, self, name))
        nameflag = true;
       num++;
       wd = NextWord();
     }
     if (~~nameflag)
        return 0;
     return num;
   ],
which will check both the "adjective" and "name" properties (both of which,
obviously, must exist, or you'll get a rather nasty crash), but only return true
if words from "name" have been supplied.

Actually, if you're slightly more clever about the whole thing than I was, you
can probably make the "adjective" check optional (using "if (self provides
adjective)"), which will let you just wrap this into a class, making the whole
thing transparent to your other programming.  You can still do that with this
version, but your class needs to supply an adjective property (empty,
presumably), which seems a bit inelegant to me.

I believe this is going to be the easiest approach, though, regardless.  Well,
unless you need another parse_name somewhere else.  Then it gets nasty, if I'm
not mistaken...or is parse_name another one of those "nestable" properties that
form a list?  I forget.


