Thanks Grog,, I'll look it over and consider it, because I do plan on adding functionality to the parser. My intention was to nail down a simple verb/object parser, "complete" with a simple game. Using it as a code snippet example/tutorial on Text Adventure/Parser-tokenizers.
Then I'll build on the basics to include ignoring "filler/noise" words like "a", and "the"; as well as the addition of parsing indirect-objects or prepositional phrases.
The parser would handle 3 predicate parts; verb, the direct object, and the indirect object or Prepositional phrase.
Finally, I would handle adjectives to modify nouns, and adverbs to modify verbs.
******
An example from the text I'm using ('Compute!'s Guide to Adventure Games', ©1984) would parse the following... (with the assumption that nothing precedes the verb; except perhaps... a noun of address)
"GIVE THE LITTLE PIG TO THE BIG BAD WOLD QUICKLY"
* The verb (GIVE), modified by an adverb (QUICKLY)
* The object (PIG), modified by one adjective (LITTLE)
* The indirect object (WOLF), related to the verb by a preposition (TO) and modified by two adjectives (BIG and BAD).
so in BNF Form:
command ::= basic-command [adverb]
basic-command ::= predicate object | predicate indirect-object
|predicate object preposition indirect-object
predicate ::= verb | verb short-adverb
indirect-object ::= object
subject ::= {adjective} noun | object AND {adjective} noun
That's about as far as I will take the parser/tokenizer. After the first example I will make use of IanM's matrix1utils to ease the burden.
Your signature has been erased by a mod please reduce it to 600 x 120.