Section 1 - Understanding
Understand the command "ask" as something new. Understand the command "tell" as something new. Understand the command "say" as something new. Understand the command "speak" as something new. Understand the command "shout" as something new. Understand the command "answer" as something new. Understand the command "scream" as something new.
Understand "mention no" as saying no. Understand "mention yes" as saying yes. Understand "mention sorry" or "apologize" as saying sorry. Understand "refuse" or "disagree" as saying no. Understand "approve" or "agree" as saying yes.
Understand "mention awk/awwk/awwwk/squawk" as squawking.
Understand "ask about [any subject]" as mentioning. Understand "tell about [any subject]" as mentioning. Understand "a [any subject]" as mentioning. Understand "t [any subject]" as mentioning. Understand "answer [any subject]" as mentioning.
[Just for fun, let's make the game understand a wide range of parrot-appropriate squawkings, too:]
Understand "mention [any subject]" as mentioning. Understand the commands "caw" and "croak" and "squawk" and "awk" and "awwk" and "speak" and "say" and "talk" and "shout" and "scream" and "shriek" and "yell" and "screech" as "mention".
[Now having given the parrot this range of expression, let's make it so that we can print that exact text back later:]
To say exact verb:
(- print (address) verb_word; -)
[But of course, if the player uses t or a the results will come out a bit strange. Therefore:]
After reading a command: if the player's command includes "t ", replace the matched text with "say "; if the player's command includes "a ", replace the matched text with "say "; if the player's command includes "mention ", replace the matched text with "say "; if the player's command includes "speak ", replace the matched text with "say ".
Instead of asking someone to try mentioning something: try mentioning the noun instead.
[Here we handle the error case wherein someone does try to speak to a specific individual:]
Understand "ask [someone] about [text]" as directed speech (with nouns reversed). Understand "tell [someone] about [text]" as directed speech (with nouns reversed). Understand "answer [text] to [someone]" as directed speech.
Instead of answering someone that something: say "You can only squawk things for everyone to hear."
[And finally, to cover the case where the player types something like SQUAWK "KING":]
Include Punctuation Removal by Emily Short.
After reading a command:
remove stray punctuation; [1]
if the player's command includes "&", replace the matched text with "and".
Note
[1]. A phrase provided by the foregoing extension, which removes all quotation marks, exclamation points, and question marks from input before attempting to parse