My version does seem to take care of those pitfalls.
“NORTH. TELL GORDON TO TAKE CROWBAR” gets processed as going north and then a telling it to action that gets turned into “GORDON, TAKE CROWBAR.”
“ASK GORDON ABOUT HIS TRIP TO THE BEACH” doesn’t get turned into a commanding action, because the part between “ask” and “to” doesn’t match the “[someone]” token.
“TELL GORDON TO TAKE CROWBAR. JUMP” does get converted into two commands to Gordon, to take the crowbar and then jump, but this is the same as the out-of-the-box behavior for “GORDON, TAKE CROWBAR. JUMP.” (It’s like “TELL GORDON TO TAKE THE CROWBAR THEN JUMP” which is ambiguous in English.)
zarf, I wasn’t sure what your “>TELL GORDON TO TAKE CROWBAR” pitfall was–that seemed to work OK in Mike’s code?
Anyway, here’s what I have for the test case. And I’m sure there are plenty of pitfalls there. (One thing is that it’ll surely break when “[commanded person]” results in text that can’t be understood or is ambiguous, but that’s a bad situation anyway.) I wouldn’t trust it much around disambiguation although this simple case seems to work.
[code]Test Chamber is a room.
A man called Gordon Freeman is in the test chamber. A man called Flash Gordon is in the test chamber. The crate is an open container in the test chamber. The crowbar is in the test chamber.
Persuasion rule:
persuasion succeeds.
Telling it to is an action applying to one thing and one topic. Understand “tell [someone] to [text]” as telling it to. Understand “ask [someone] to [text]” as telling it to. Understand “order [someone] to [text]” as telling it to.
Converting a tell command is a truth state that varies. Command text is some text that varies. The commanded person is a person that varies.
Carry out telling it to when converting a tell command is false:
now converting a tell command is true;
now the commanded person is the noun;
now the command text is the substituted form of “[the topic understood]”.
For reading a command when converting a tell command is true:
now converting a tell command is false;
change the text of the player’s command to “[commanded person], [command text]”.
Instead of telling Gordon Freeman about something: say “You say, ‘Did you know about [the topic understood]?’ Gordon says nothing, as usual.”
Test me with “ask freeman to take the crowbar / tell freeman to put the crowbar in the crate / order freeman to jump/ jump. tell freeman to take the crowbar/ ask freeman to drop the crowbar. jump/ tell freeman about my trip to the beach/tell gordon to x gordon/freeman”.[/code]