[i7] clarifying the parser's choice

First, check this out:

[code]Test Chamber is a room.

In the Test Chamber is a woman called Marge. Understand “woman” as Marge.

A picture of a woman is in the Test Chamber.

Does the player mean kissing Marge: it is likely.

Before clarifying the parser’s choice of something, say "CHOOSING: "

Test me with “kiss woman / ask woman about her day”.[/code]

When you “kiss woman”, the parser chooses Marge (which the “does the player mean” rule instructs it to do), and then it clarifies its choice, with the helpful signal “CHOOSING”.

However, when you “ask woman about [something]”, although the parser chooses Marge and prints a clarifying message, it is NOT running the “clarifying the parser’s choice” activity. I’m thinking this must have something to do with the [someone] token in the grammar for the asking it about action.

For various arcane reasons, I want to suppress that second clarifying message in my WIP. Anyone know where it comes from and/or have an idea of how I might kill it?

UPDATE: On second thought, I don’t think it is the [someone] token – because the kissing action uses that token as well. After some more experimentation, I think this “pseudo-clarification” only happens when 1) the player’s command involves two nouns, and 2) the noun that requires clarification is the first noun in the command.

In other words, typing GIVE FRUIT TO WOMAN disambiguates normally, and uses the “clarifying the parser’s choice” activity when required. But GIVE WOMAN THE FRUIT causes the parser to automatically choose Marge and print the dubiously clarifying message “(Marge fruit)”, which bypasses the normal clarifying the parser’s choice activity.

(You managed to get this into the TADS forum…)

This occurs in the PrintInferredCommand() I6 function, and that seems to only invoke the activity when there’s exactly one noun to print. (The actual condition is messier.)

I suspect that it’s because activities are inherently based on a single argument. There’s no way for the function to say (the equivalent of) “carry out the clarifying activity on the noun and the second noun.” Carrying out the activity twice isn’t a good option, because the goal is to print a single message.

You may be stuck hacking this at the I6 level.

Hmm. I’m getting a compiler error when I try to replace the PrintInferredCommand routine. Is there an obvious reason why this wouldn’t work?

[code]Include (-
Replace PrintInferredCommand;

[ PrintInferredCommand from singleton_noun;
singleton_noun = FALSE;
if ((from ~= 0) && (from == pcount-1) &&
(pattern–>from > 1) && (pattern–>from < REPARSE_CODE))
singleton_noun = TRUE;

if (singleton_noun) {
	BeginActivity(CLARIFYING_PARSERS_CHOICE_ACT, pattern-->from);
	if (ForActivity(CLARIFYING_PARSERS_CHOICE_ACT, pattern-->from) == 0) {
		print "("; PrintCommand(from); print ")^";
	}
	EndActivity(CLARIFYING_PARSERS_CHOICE_ACT, pattern-->from);
} 
! else {
!	print "("; PrintCommand(from); print ")^";
! }

];
-) after “Definitions.i6t”.
[/code]

I’ve commented out the else clause, so if the activity doesn’t run, the routine does nothing. I get this error, though:

EDIT: nevermind, I figured it out. The Replace directive has to go after Definitions.i6t; the routine itself does not.