[MUD-Dev] User Input Parser, was Re: darkness/visibility
Richard Woolcock
KaVir at dial.pipex.com
Mon Jun 15 20:33:27 CEST 1998
T. Alexander Popiel wrote:
>
> In message: <3584199E.29AF at dial.pipex.com>
> Richard Woolcock <KaVir at nospam.dial.pipex.com> writes:
> >
> > ]get the sword and examine it
> >
> >I also differentiate 'it' and 'them' depending on whether or not the object
> >ends in the letter 's'.
>
> Random note: discriminating on 's' is poor; consider referring to
> 'several people' or 'the grass'. Better to have your objects tagged
I use it only to refer to objects at the moment, although I see no problem
with 'a human' compared to 'a crowd of humans'. In addition, if I typed 'get
grass' in a room I wouldn't expect to pick up a single blade of grass. I
do however differentiate 'knives' from 'knife', and have yet to find any
situation in my mud in which my solution doesn't work. I'm not saying its
perfect, just that it does everything I need it for.
> as singular, plural, or aggregational. (Aggregational is important
> so you don't pour one bucket of water into another bucket of water
> and get a bucket of waters...)
I would end up with 'a couple of buckets of water' or 'a couple of pools of
water'. Once again, this seems acceptable.
> > ]get the bread from my backpack
> > You get a loaf of bread from your leather backpack.
> > ]eat it
> > You attempt to stuff the leather backpack into your mouth.
>
> I would expect the direct object to take precedence over the
> prepositional indirect object. Of course, the only real solution
I have to be careful, for example:
]draw my sword, then pick up the shield and wear it.
In my code as it stands, that would make you draw your sword, then
pick up and wear the shield, which seems acceptable. The following:
]pick up the backpack, get the knives from it and wield them
Would pick up a backpack from the floor, get every knife from it, and
attempt to wield as many as you had free hands. On the other hand:
]pick up the backpack, get the knife from it and wield it
Would pick up a backpack from the floor, then try and get a knife from
a knife - give up - and then try to wield a knife from your inventory
if you had one in there. You would have to get around this by typing:
]pick up the backpack, get the knife from the backpack and wield it
This is where I am having problems really. For my first attempt at a
parser its not really that bad though, specially considering I only
spent a couple of evenings writing it.
> is to maintain list of possible antecedents (prioritized via some
> method (hopefully with actual use increasing priority)), and then
> see which of the possible antecedents actually fit the circumstances.
> This need not take up huge amounts of memory, since humans have
> severe limits on list size (generally no more than 7, though beware
> inobvious aggregates acting as a single entry), and there's not
> much point in outperforming humans here.
>
> > [remove my backpack and get my sword and cheese from it, then eat it and
> > sheath it
> >
> >Which is...well...just silly. Perhaps I should leave it as it is - its just
> >that I feel I could take it further.
>
> Yeah, it's kind of silly, but what's the harm in that, as long
> as nobody gets confused?
Maybe. Right now it is the easiest way I can see to get the parser working
properly.
KaVir.
More information about the mud-dev-archive
mailing list