Path: news.duke.edu!newsgate.duke.edu!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!192.149.109.217!not-for-mail
From: cerutti@together.net (Neil Cerutti)
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Removing Verbs (Good news/Bad news)
Date: 26 Feb 2001 18:36:17 GMT
Lines: 113
Message-ID: <slrn99l906.8u.cerutti@fiad06.norwich.edu>
References: <3A9D8A40@MailAndNews.com>
Reply-To: cerutti@together.net
NNTP-Posting-Host: 192.149.109.217
X-Trace: fu-berlin.de 983212577 25684278 192.149.109.217 (16 [60390])
User-Agent: slrn/0.9.6.3 (Win32)
Xref: news.duke.edu rec.arts.int-fiction:83923

Kathleen M. Fischer posted:
>Well... the GOOD news is that the fix worked as advertised!
>Typeing in LEAVE causes my "You mumble something
>incomprehensible." message to appear.  :)
>
>The BAD news is that it doesn't solve the problem I was trying
>to fix - most likely because I lied about my intentions. The
>following is a easy to describe example of what I really want to
>do... and I think it should results the same effect as what I'm
>really trying to do... but I haven't tested it <Bad poster. No
>buiscut.>
>
>If you have two objects, say:
>
>*** FAKE-CODE ***
>Object "red push button"
>  with name 'red' 'push' 'button';
>Object "blue pull button"
>  with name 'blue' 'pull' 'button';
>
>You get the following (again, I haven't tested this):
>
>*** FAKED TRANSCRIPT ***
>>X BUTTON
>Which do you mean, the red push button or the blue pull button?
>
>>push
>What do you want to push?
>
>... assuming that's true (and it is for my real example, which
>is rather more complicated to explain), then what I was trying
>to do was simply remove PUSH (or in my case, LEAVE) as a valid
>Verb, so disambiguation will happily allow it as a noun and get
>on with it.
>
>Suggestions?

That's really weird. I coded a fix to this problem several years
ago when I wrote the FischerBoxes class in response to a
challenge you posted to this group!

FischerBoxes needed to disambiguate between open and closed
boxes, the exact same problem you're facing.

As Andrew wrote, you need to hack the library somewhat. The code
I wrote created an new optional entry point to allow you to
define new words that you would like the library to think of as
nouns when disambiguating.

Here's the relevant bits:

  >take box
  Which do you mean, the open box or a closed box?

  >open
  Taken.

End of transcript.

It was necessary to hack the library. Here is a 'diff -u' between
pre-hack library and post-hack.

(I don't remember what version of the library this is, but it's
at least as recent as 6/8.)

*
--- parserm.h  Thu Jul 15 15:27:54 1999
+++ hparserm.h Thu Jul 15 14:19:30 1999
@@ -2168,11 +2168,20 @@
   #endif;
   if (first_word ~= 0)
   {   j=first_word->#dict_par1;
+      #ifndef IsNameVerb;
       if ((0~=j&1) && (first_word ~= 'long' or 'short' or 'normal'
                                      or 'brief' or 'full' or 'verbose'))
       {   CopyBuffer(buffer, buffer2);
           return REPARSE_CODE;
       }
+      #endif;
+      #ifdef IsNameVerb;
+      if ((0~=j&1) && ((first_word ~= 'long' or 'short' or 'normal' or 'undo'
+        or 'brief' or 'full' or 'verbose') && IsNameVerb(first_word) ~= 1))
+      {   CopyBuffer(buffer, buffer2);
+          return REPARSE_CODE;
+      }
+      #endif;
   }

 !  Now we insert the answer into the original typed command, as
*

This creates an optional routine called IsNameVerb that must be
declared before inclusion of "parser.h" if at all.

The routine receives a dictionary word and returns true to
tell the library to treat this verb as a noun after asking a
disambiguation question.

Here's an example of IsNameVerb:

--*--
[ IsNameVerb wd;
  if (wd == 'open') rtrue;
  else rfalse;
];

I hope this helps.

--
Neil Cerutti <cerutti@together.net>
"If you're gonna score 125 points in a game, you've only got to
play good enough defense to hold the other team to 124. How
the hell hard is that?" -- Red Auerbach
