What would be involved in removing automatic plural-name parsing?

By default, Inform doesn’t recognize the names of kinds. X DOOR won’t work unless you (or the library) explicitly Understand “door” as a door.

However, it does recognize the plural names. X DOORS does work straight out of the box…and always fails, because examining can’t take multiple objects. The intent is presumably for indistinguishable objects: if you make five coins, TAKE COINS should take all of them instead of just one. But it has the side effect of making the word inherently and irrevocably plural: if you have an object in your game called “a pair of double doors”, there’s no possible “does the player mean” rule that will let you unambiguously X DOORS. (Worse yet, this means the words “container” and “supporter” are always recognized and always plural, since the dictionary only stores the first nine letters of a word: “containers” and “supporters” are ten letters long.)

My standard solution is to say “The plural of door is asdfasdf” and so on for all the other kinds I want to override. But this is very clearly a hack, and also means a pair of unnamed doors will be described as “two asdfasdf” in room descriptions.

How difficult would it be to simply remove this behavior from the compiler? I haven’t been able to find where exactly this is implemented. If authors want a particular word to be understood as a plural, that’s still possible (Understand “coins” as the plural of a coin)—I just find the compiler’s automatic handling to be undesirable more often than not, and there’s currently no clean way to disable or override it.

Having previously thought about how such a feature could look at the language level, Understand nothing as the plural of door seems obvious enough, in direct parallel of an existing syntax to assert that dictionary entries shouldn’t be created.

Which doesn’t, of course, help at all with your question as asked; I don’t know where it’s implemented either or what would need to change either.

(Only semi-related regarding the container and supporter cases: I think it’d be a beneficial change to default to a DICT_WORD_SIZE of 12 or 13 on glulx…)

1 Like

Looks like the relevant bit is if module Chapter 5: Command Parser particularly Understand sentences and Command grammar lines. There’s plenty of other stuff about plurals (like setting the printed plural name) but that seems to be the stuff about creating grammar lines.

1 Like

The solution to this particular annoyance is to write The printed plural name of a door is usually "doors". which restores this as the default plural in printed output without affecting ‘asdfasdf’ as the plural name the parser recognises in commands for every door.

3 Likes