MUDs don't actually parse English. They parse commands. So, let's say you type in "kill floober with sword". What happens is roughly analagous to:
my @command = split /\s+/, $input; my $cmd_name = shift @command; complain("$cmd_name isn't a command\n") unless exists $dispatch_table{ +$cmd_name}; $dispatch_table{$cmd_name}->(@command); # And the function called with handle "floober with sword"

Good MUDs (which was a small minority ten years ago) will strip out words like a, the, and the like, so that parsing is easier.

Better MUDs will use those words to help figure things out. So, you could say something like "kill all the floobers with my magic sword" and the MUD will actually set your attack flag to attack all the floobers in the room and will use your magic sword (as opposed to your non-magic sword or your magic spear). But, that command pre-processing is difficult to locate because it does a common activity, but (potentially) requires a ton of information that crosses all the data structures. (The room, the character, the other PCs/NPCs in the room, etc.)

(The standard DikuMUD would complain "I see no 'floobers' in this room!" or some such if you tried the second line.)

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.


In reply to Re: Parsing english by dragonchild
in thread Parsing english by wolis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.