Message-ID: <3AC72CAB.24160048@csi.com>
Date: Sun, 01 Apr 2001 09:27:08 -0400
From: John Colagioia <JColagioia@csi.com>
X-Mailer: Mozilla 4.61 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: Infocom and Magnetic Scrolls parsers
References: <3ac61b3e.77987573@News.CIS.DFN.DE>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 128.238.10.133
X-Original-NNTP-Posting-Host: 128.238.10.133
X-Trace: excalibur.gbmtech.net 986131627 128.238.10.133 (1 Apr 2001 08:27:07 EST)
Organization: GBM Technologies Ltd
Lines: 108
X-Authenticated-User: jnc
Path: news.duke.edu!newsgate.duke.edu!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!newsfeed.online.be!ams.uu.net!nyc.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:84851

Carl Muckenhoupt wrote:

> I've been thinking lately about the various parser improvements that
> were made during the Golden Age but which aren't (yet) part of any
> system's standard library -  in particular, things done by the
> Magnetic Scrolls parser, and things done by specific Infocom games
> that never became "Infocom-standard".
> Examples:
> From Infocom:
> The "name" command from Beyond Zork.  ("Balances" contains code for
> attaching names to featureless white cubes, but it's not easily
> generalizable.)

Ooh!  I can contribute, here!  Me-me-me!  I actually did generalize this
into a "Nameable" class for one of my hundreds of minor projects that may
never see the light of day.  I'll clean it up and probably drop it in the
archive during the week.


> The ability to address multiple NPC's at once, from Suspended.  ("Both
> poet and waldo, lift tripwire")

I actually wanted something like this, as well for something.  I tried to
do it, and failed pretty miserably.


> Noun-only commands, from Nord and Bert.  Typing in a noun without a
> verb is equivalent to "examine" or "go", depending on whether it's a
> room.

That doesn't SOUND too difficult.  In theory, one should be able to try to
parse, and on a failure, restart with Go and/or Examine as the first
word.  I think...

BeforeParsing(), is it?

[...]

> Word order in nouns.  The MS parser distinguishes "pot plant" from
> "plant pot", which the Inform parser doesn't.  (However, this really
> only applies to Inform.)

The parse_name property does this fairly easily, doesn't it?  One would
check for any adjectives except 'pot' or 'plant', check for either of the
two keywords, then check for the other (maybe checking for more adjectives
in the middle, depending).


> Adjectival prepositional phrases.  "Examine the cube on the table".
> This would require a fairly large amount of coding to do in any system
> I know of.

That, too, sounds like a job for parse_name().  Something like (after
hacking through the name, itself, and assuming the parse_name on
http://www.eblong.com/zarf/inftricks/tip_parsename.html):
    if (parent (self) ofclass Thing) ! Thing being a "not a room" class
        {
         if (wd ~= 'on' or 'in')
            return (num);
! Now check for the parent object's name.
        }

Hm.  Let's try that before we send it out...

Yep.  I'm satisfied.  This isn't pretty (and only works in the one room,
although I suspect that using classes would fix that part), but it works:

Object Startroom "Someplace"
   with description
      "It looks like a nice place for putting things on tables.";

Object -> Table "table"
  with name 'table',
 description "A simple, square, wooden table.",
  has supporter static;

Object -> Thingie "thingie"
  with name 'thingy' 'thingie',
 description "Beats me.",
 parse_name
  [ wd num ;
   wd = NextWord();
   while (WordInProperty (wd, self, name))
   {
    ++ num ;
    wd = NextWord ();
   }
   if (self notin Startroom or Player)
   {
    if (wd ~= 'on' or 'in')
    return num;
    ++ num ;
    wd = NextWord ();
    while (WordInProperty (wd, parent (self), name))
    {
     ++ num ;
     wd = NextWord ();
    }
   }
   return num;
  ];


> ...Anything else I'm missing?

Heh--I hope so.  This is kind of fun...


