Couldn't you do some kind of matching system, where the NPCs are loaded up with strings and responses:
"Someone would like to buy a candle"
'Here is your candle'
The npc text parser would pack this down into some code you would include, but essentially it would only pack
q:"someone buy N candle"
a:"Here [is/are] your candle[s]"
Then when someone types in
"I would like to buy your candle"
"I would like to buy 2 candles"
"I would like to buy a candle from you"
"I would like to buy the candle"
You parse out the 'unimportant' words:
I buy a/your/the/N candle[s]
further parsing would equate a/your/the to 1, and strip off the [s] from candles.
Then you look for
I buy N candle
do a reverse lookup so you first match for candle, then N, then buy, and you filter out
"A would like to have a candle buy my ear"
"Buy a candle from me"
"buy a candle from the man" // its a conversation, not a text adventure game
"Put the candle buy from you in my ear"
anyways.. symbol tables etc.
Some of the scripting tutorials might give you a good idea on implementing symbol tables.
[This message has been edited by Sphet (edited September 23, 1999).]
I was thinking about this.