in reply to Parsing english

As people have said above, you'll make your life a lot easier if you can constrain the complexity of the sentences which you're trying to parse, and perhaps also limit the vocabulary which can be employed by the user. If you can end up with a grammar like (in pseudo-regex-code)

[VERB] the|a|some [ADJECTIVE]* [OBJECT]? \ [to|for|from|with INDIRECT-OBJECT]? [ADVERB]? "Create a small white mouse quickly." [V] [ADJ] [ADJ] [OBJ] [ADV] "Give some tasty peanuts to the mouse." [V] [ADJ] [OBJ] [I-OBJ] "Eat the mouse noisily." [V] [OBJ] [ADV]

You can parse quite an expressive range of sentences especially if you know what parts of speech (verbs, nouns, adverbs etc.) different tokens are. This is the Parse::RecDescent approach.

A deeper more "linguistic" approach might be to use something like a link parser, which is a package that analyses the structure of natural language sentences. There's several available free on the web, although I've never used one with Perl, only with Other Languages. There are lots of other free linguistic resources available on the web which you might find useful, including WordNet, which you can use to look up hyponyms, synonyms and hypernyms ....

.... but this is probably all a bit much for making a small mouse ...

ViceRaid