[MUD-Dev] Text Parsing

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Tue Jun 1 19:35:51 CEST 1999


[Ross Nicoll:]

> I've worked on text games in the Infocom format, and the parser is hardly
> simple. About 280k of Inform code is used, just for the basic parser, 

<Blink!>

ami-cg /home/cg/MUD/Src/MUDServ % wc match.c parse.c
    989    3280   19010 match.c
   1855    5948   40763 parse.c
   2844    9228   59773 total

Handles nearly as much as I've seen an Infocom parser do.

> Wouldn't take much memory, but coding time would be very, very long
> compared to a simple parser, and it would have a much higher CPU usage too
> (although that may not make so much of a difference).

<Blink Blink!>

Why would it take a lot of CPU time? That all depends on the method you
use. If you use an actual pattern matcher for each kind of sentence, or
for each possible verb combination, then yes, that can take a lot of CPU.
However, if you just pull off the verb, find the other parts of the
command, and then process according to the verb's requirements, there is
little CPU involved. Thinking about mine, its mostly linear in the number
of words (or characters, pretty much the same thing) in the command. I've
never even seen the parser show up in my profiling runs.


To reply here to Ola's note, whether or not I agree on whether there is
any point in being between a really simple and a full AI parser depends
on the definition of 'really simple'. If that really simple parser can't
handle lists of objects, position indicators, synonyms, multiple meanings
for words, articles like 'the', 'a', 'an', etc. then I disagree - that
is *too* simple for me as a player. I do agree about the parser not
making non-obvious choices for the player, however.

--
Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg at ami-cg.GraySage.Edmonton.AB.CA
               http://www.GraySage.Edmonton.AB.CA/cg/


_______________________________________________
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