Okay! Just had an absolute party with @johnnywz00, and we found a solution to a problem, and then I realized we solved the wrong problem, but I hope that thread proves useful to future explorers.
Now! The actual problem I was having!
Let’s say we have a set of objects (with the following vocabs):
- left box
- right box
- front box
- back box
All four of these have identical descriptions.
If I say EXAMINE BOX, a disambiguation comes up:
Which do you mean? The left box, right box, front box, or back box?
and the player then clarifies:
>right
and the right box’s description is shown.
But we have a problem. If the player uses EXAMINE BOXES, then the game says “Yeah, sure, comin’ right up, cap’n!” and prints four identical descriptions for all four boxes.
We can filter out matches using the following:
class Box: Thing {
filterResolveList(np, cmd, mode) {
if (doNotFilter()) return;
if (np.matches.length > 1) {
np.matches = np.matches.subset({m: m.obj != self});
}
}
doNotFilter() {
// Code that solves the upcoming logic problem...
}
}
So, here’s the logic problem:
At the filtering stage, how can we determine if the player is referring to multiple nouns as a plural versus one noun among many, which could require disambiguation? What can I put into doNotFilter()
that would return nil
if the player referred to a plural form of a noun, which matches multiple nouns?
Thank you for your time!