in reply to Parsing english

Unless you want your command entry to quickly become the main focus of your game, you might consider using a simplified grammar and lexicon that shoots for about 90% interpretation accuracy at about 70% precision. Just make sure you know what your verbs (V), nouns (N), and adjectives (A) are.

So, as far as syntax is concerned, with English you have an advantage for commands. Commands start with verbs and have zero or more arguments having something to do with the verb's action. (I imagine you are *doing* stuff in your game, so I wouldn't bother accounting for stative verbs.)

Your command boils down to:

create(mouse)
where mouse(small, white)

So you have the combinations V(N) and N(A,A)... and there you have your objects and their properties. You might also want some stemming, so the Lingua:: modules on CPAN (Lingua::Stem::En) should be of some help.

Each verb will have to have its arguments defined. Your example of "create" can have one argument type, which is whatever you are creating. You will also have to check to make sure the thing you are creating is creatable, i.e. your lexicon will have to know which actions apply. You might also need to account for movement. Luckily, movement is well-studied and very well-formalized. You move FROM (LOCATION) VIA (LOCATION) TO (LOCATION). Here, you can use keywords to map your path.

I've got to run now, but I'll be more than happy to respond in more detail later. (I came back.)

You might want to look at http://citeseer.nj.nec.com/ and search for "parsing english" (query results). You'll find lots of academic articles... somewhere there's bound to be some introductory material. If that fails, then look for a copy of Natural Language Understanding by James Allen (link) at the University of Rochester.

Update: Fixed some sloppy grammar, added more detail.

--
Damon Allen Davison
http://www.allolex.net

Replies are listed 'Best First'.
Re: Re: Parsing english
by wolis (Scribe) on Oct 09, 2003 at 03:00 UTC
    This Lingua:: stuff looks intruiging.. but my quick skim over its surface found no 'concrete' examples of what it actually is what what it does..

    ..looks like I need that PhD afterall :-)

    ___ /\__\ "What is the world coming to?" \/__/ www.wolispace.com