Responsive Disambiguation for 6M62 by Matt Weiner


Responsive Disambiguation is a plug-and-play extension; it should have its desired effect merely by including it.

It is intended to produce more responsive behavior in response to disambiguation questions. The usual state of affairs is that when the I7 parser asks "Which do you mean, the red block or the blue block?", it determines whether what the player types is meant as an answer to the question by testing whether the first word is a verb. Usually this will work, but if it has asked (say) "Which do you mean, the Go board or the chess board?" then it will treat the reply "Go" as a new command (to go in some unspecified direction) even though "Go board" was one of the answers listed.

Responsive Disambiguation resolves this by testing any answer whatsoever to the disambiguation question to see whether it would work as a disambiguation. As is the usual behavior with disambiguation, it inserts the answer into the original command and runs the command. If it does not result in a parser error, it is a successful disambiguation. If it does result in a parser error, then Responsive Disambiguation copies the answer (still held in the I6 buffer2) into the standard player input buffer (the I6 buffer), setting a flag to indicate that we are now processing a failed attempt at disambiguation.

It then allows the parser to process the old command as a parser error, but suppresses the output with a For printing a parser error rule that fires when the flag for processing a failed disambiguation has been set. That flag then causes a For reading a command rule to run that preempts the ordinary mechanism of reading a command; since buffer has already been filled with the response to the disambiguation prompt, this is now processed as a new command.

Responsive Disambiguation also changes the behavior of disambiguation in a command given to NPCs. The default behavior without Responsive Disambiguation is to insert the disambiguation response into the command, and if the command cannot be parsed to process it as the answering it that action. So this

>Bob, x board

Which do you mean, the chess board or the go board?

>north

would be treated as though we had typed "Bob, x north board," yielding the action of answering Bob that "x north board". Under Responsive Disambiguation, "north" is treated as a new command.

Since Responsive Disambiguation directly modifies Noun Domain and other parts of the Inform 6 parser template, it will not be compatible with other extensions governing disambiguation that also modify the template. However, Responsive Documentation does not make too many changes to the parser, and it should be reasonably straightforward to copy them into other modified versions of NounDomain and Parser Letter H. All changes are marked with I6 comments beginning "RD:".

Also, Responsive Disambiguation may react unpredictably with After Reading A Command rules. Authors should be careful!

Please contact me at (myfirstname) @ (myfirstname) (mylastname). net with any issues or suggestions, or PM me at intfiction.org (my username is matt w).

Example: * Games Room - A simple example of Responsive Documentation.

Include Responsive Disambiguation for 6M62 by Matt Weiner.

Games Room is a room. A chess board and a Go board are in Games room.

Test me with "x board / go / x board / jump / x board / fthagn".