Ticket #5 (new task)
Create basic CommandParser
| Reported by: | ged | Owned by: | ged |
|---|---|---|---|
| Priority: | high | Milestone: | VolitionEpic |
| Component: | GameWorld | Version: | 1.0 |
| Severity: | major | Keywords: | command parser link grammar wordnet input i/o verbs |
| Cc: |
Description
Create a basic CommandParser which should:
- Maintain a hashtable of Verbs which is updated via a hook when the containing Spirit animates an AnimatedObject.
- Accepts and tokenizes user input. The input method is still a bit of a mystery without MUES, but a method which assumes the input comes from somewhere in the form of a String will suffice. Also keep in mind that the tokenizing bit will eventually be replaced by a LinkGrammar? of some sort. Keeping the tokenizing bit as decoupled as possible from the rest will make it easier to accomplish this.
- Maps the first word (assumed to be the verb) to a Verb object
- Maps the rest of the words in the input to perceived objects by querying the AnimatedObject?'s Perception. Try to leave room or consideration for doing more intelligent mapping in this phase at some point in the future, perhaps using associated modifiers for disambiguation, WordNet for synonym, meronym, and hyperym lookup, etc.
- If either the mapping of verb to Verb object or the mapping of noun phrases to objects fails, generate an error message describing the mapping failure. We'll have to work out how exactly errors should be reported, as this requires knowledge of the end-user I/O bit, too. Perhaps a hook or callback of some sort?
- Calls the Verb's #happen method with the mapped objects if the mapping succeeded.
