[MUD-Dev] Text Parsing

Travis S. Casey efindel at io.com
Thu Jun 3 08:10:42 CEST 1999


On Wed, 2 Jun 1999, Chris Gray wrote:
> [Travis S. Casey:]

> > This could cause a problem if you're not careful about naming, since
> > "from" can be a part of a name -- e.g., "the man from UNCLE".  It's not a
> > common case, but it could happen.
> 
> Yep. Any systems out there that *do* handle something like that? If I
> stick to a medieval MUD, the United Nations Command for Law Enforcement
> would be a big anachronism :-)

It shouldn't be too hard to handle.  There's a couple of ways I can think
of off-hand:

 - always try the whole phrase first, then try it using the "from" rule.
   (E.g., if someone "look at man from uncle", the parser should try 
   "look at (man from uncle)" before "look at (man) from (uncle)".)

 - try both ways, and do whichever one makes a valid command.  If they
   *both* do, you've got ambiguity.  How you want to resolve it is up to
   you.  (e.g., "get sword from castille".  Try both "get (sword) from
   (castille)" and "get (sword from castille)" to see if you can find
   matching objects.  If there's no "castille" present, but there is a
   "sword from castille", this will result in the second version being
   used.

--
       |\      _,,,---,,_        Travis S. Casey  <efindel at io.com>
 ZZzz  /,`.-'`'    -.  ;-;;,_   No one agrees with me.  Not even me.
      |,4-  ) )-,_..;\ (  `'-'
     '---''(_/--'  `-'\_) 



_______________________________________________
MUD-Dev maillist  -  MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev




More information about the mud-dev-archive mailing list