With this fix in place, the ambiguous ‘take sheep’ (which could in English mean ‘take the sheep’ (singular) or ‘take the sheep’ (plural), equivalent to ‘take all the sheep’) is parsed with a singular meaning, which aligns with the parser’s general prejudice for interpreting ambiguous phrasings as having singular meaning where possible e.g.:
"Four Candles" by PB
The Agent's Office is a room. The table is a supporter in the office.
A script is a kind of thing. A script called Four Candles is on the table.
After printing the name of Four Candles when listing nondescript items: say " (a comedy script for The Two Ronnies)".
A candle is a kind of thing. Four candles are on the table.
after which:
Four Candles
An Interactive Fiction by PB
Release 1 / Serial number 240117 / Inform 7 build 6M62 (I6/v6.41 lib 6/12N) SD
Agent’s Office
You can see a table (on which are Four Candles (a comedy script for The Two Ronnies) and four candles) here.
>take four candles
Taken.
>i
You are carrying:
Four Candles
The way this works under the hood is that on parsing the command ‘take four candles’ the parser
(i) initially assumes that we are looking for four items matching ‘candles’ and looks to create a list of items matching that word
(ii) each time it finds an object matching ‘candles’ it goes back to check whether its name actually could match the full phrase ‘four candles’
(iii) if the parser finds at least one object that matches ‘four candles’, it assumes that the player meant to refer to (one of) that/those object(s) rather than to any four objects matching just ‘candles’.
Hence here it chooses taking ‘Four Candles’ over taking four ‘candles’.
This method of working leads to some interesting side effects. if we replace the Four Candles script with some fork 'andles:
Some fork 'andles are on the table.
Understand "four candles" as the fork 'andles.
then we get
Agent’s Office
You can see a table (on which are four candles and some fork 'andles) here.
>take four candles
candle: Taken.
candle: Taken.
candle: Taken.
candle: Taken.
because as written, the parser will only match the full phrase “four candles” with the fork 'andles
object, not ‘four’ or ‘candles’ alone, and so it can’t match the fork 'andles
against just the word ‘candles’ (step (ii)), and so it never goes back to check whether it might actually match ‘four candles’, so the fork 'andles
remain unmatched and the parser goes on to process the list of four candles
that it has matched. Change the Understand phrase to Understand "four" or "candles" as the fork 'andles
and the parser will treat the fork 'andles
object in the same way as it did the script, because it can now match just ‘candles’ alone against the fork 'andles
object:
Agent’s Office
You can see a table (on which are four candles and some fork 'andles) here.
>take four candles
Taken.
>i
You are carrying:
some fork 'andles
If we have the script, the candles and the fork 'andles (matched only against the full phrase “fork handles”) present, then even more weirdness ensues:
Some fork 'andles are on the table.
Understand "four candles" as the fork 'andles.
A candle is a kind of thing. Four candles are on the table.
A script is a kind of thing. A script called Four Candles is on the table. After printing the name of Four Candles when listing nondescript items: say " (a comedy script for The Two Ronnies)".
Agent’s Office
You can see a table (on which are some fork 'andles, four candles and Four Candles (a comedy script for The Two Ronnies)) here.
>take four candles
Taken.
>i
You are carrying:
Four Candles
Here the parser is not making a match against the fork 'andles
, and chooses Four Candles as the sole match…but switch the order in which the script and the fork 'andles are declared (and therefore switch which is matched against first by the parser as it works its way through the object tree):
A script is a kind of thing. A script called Four Candles is on the table. After printing the name of Four Candles when listing nondescript items: say " (a comedy script for The Two Ronnies)".
A candle is a kind of thing. Four candles are on the table.
Some fork 'andles are on the table.
Understand "four candles" as the fork 'andles.
Agent’s Office
You can see a table (on which are Four Candles (a comedy script for The Two Ronnies), four candles, and some fork 'andles) here.
>take four candles
Four Candles: Taken.
fork 'andles: Taken.
and now both the fork 'andles
and Four Candles are matched. This behaviour relates to the method discussed above by which the parser approaches ‘four candles’.
In the latter example, where the parser trys matching Four Candles first, it begins by trying a match against ‘candles’ alone first, then having matched against ‘candles’ steps back to try matching against ‘four candles’ and, having made a match, thereafter matches any in scope objects not yet considered (in this case the candles andfork 'andles
) against ‘four candles’ not just ‘candles’ alone. Consequently the fork 'andles
are matched, but the candles (which have no ‘four’ in their name) are not.
However, in the former example where the parser trys matching against the fork 'andles
first, it begins by matching against ‘candles’ alone first, makes no match, then goes on to make successful matches of the four candles against ‘candles’ alone, but then matches Four Candles against ‘candles’ alone, steps back to match against ‘four candles’, makes a match, so rejects the previous matches against the candles and doesn’t go back to retry matching any of the previously-considered objects against ‘four candles’- and so misses the opportunity to make a match against the fork 'andles
. This bug is a side-effect of the fork 'andles
matching against ‘four candles’ but not ‘candles’ alone.
We would probably expect that rather than taking both Four Candles and the fork 'andles, the parser would ask 'Which do you mean, the Four Candles or the fork ‘andles?’. This apparent misbehaviour occurs because the word ‘candles’ is compiled in the dictionary tagged as a plural form (because it appears as ‘candles//p’ in the name properties of the candles), so having rejected ‘take four candles’ as meaning ‘take four (objects matching) candles’ the command is interpreted by the parser as ‘take (all objects matching) four candles’
If we avoid ‘candles’ being tagged as a plural form in the dictionary by omitting the candles:
Some fork 'andles are on the table.
Understand "four candles" as the fork 'andles.
A candle is a kind of thing.
A script is a kind of thing. A script called Four Candles is on the table. After printing the name of Four Candles when listing nondescript items: say " (a comedy script for The Two Ronnies)".
Agent’s Office
You can see a table (on which are some fork 'andles and Four Candles (a comedy script for The Two Ronnies)) here.
>take four candles
Taken.
>i
You are carrying:
Four Candles
and switching the order of declaration (so that both Four Candles and fork 'andles get matched- see above):
A script is a kind of thing. A script called Four Candles is on the table. After printing the name of Four Candles when listing nondescript items: say " (a comedy script for The Two Ronnies)".
A candle is a kind of thing.
Some fork 'andles are on the table.
Understand "four candles" as the fork 'andles.
Agent’s Office
You can see a table (on which are Four Candles (a comedy script for The Two Ronnies) and some fork 'andles) here.
>take four candles
Which do you mean, Four Candles or the fork 'andles?