So I’m pretty mystified by an issue I’ve been encountering. Here’s a minimal example that reproduces it:
"Gray Lady"
A newspaper clipping is a kind of thing.
Understand "newspaper" or "clipping" as a newspaper clipping.
Office is a room.
A newspaper clipping called la times is here. The printed name is "a clipping of the LA Times". The description is "News about west coast stuff.".
A newspaper clipping called the new york times is here. The printed name is "a clipping of the New York Times". The description is "News about east coast stuff.".
Test me with "x newspaper / x clipping / la".
In this example, x newspaper is met with You can’t use multiple objects with that verb.. It sounds like Inform thinks ‘newspaper’ is a plural noun. Any idea how to correct this?
Unfortunately, this is a well-known bug in Inform.
The problem is that the game’s dictionary only stores the first nine letters of each word, so NEWSPAPER and NEWSPAPERS are identical. The result is that the combined NEWSPAPER(S) word is flagged as plural, and if a word has the plural flag, Inform always defaults to plural over singular. Since the standard library defines CONTAINER and SUPPORTER, two nine-letter kinds, the bug actually exists in every single Inform project, which is quite a feat!
(Or maybe it’s flagging NEWSPAPER as plural when it generates the automatic plural NEWSPAPER CLIPPINGS. That would be a new variety of the old bug, which is exciting!)
The fix for it is a little messy, but it works:
The plural of newspaper clipping is asdfasdf.
This keeps Inform from generating an automatic plural synonym. In the upcoming version of Inform, release date TBA, you can also say:
Afraid not. But assigning a nonsensical plural doesn’t actually have any bad effects, as far as I can tell: you can still use “newspaper clippings” in your source code, and it’ll never print “asdfasdf” unless you have multiple unnamed clippings in one place (i.e. with no distinctive names at all).
You could also just say the plural is “clippings”, which is nine letters instead of ten, and will avoid “newspaper” getting its plural flag set.
Do you know if this is a case where something like Use DICT_WORD_SIZE of 15. (RB Chapter 2.2) would help? It worked great for one of my own projects, but I’m unsure of any limitations/downsides to increasing the limit…
Yeah, stuff like this is why I always increase the dictionary word size to 20 or so; even in a reasonably big game (~2 hours) I don’t think there were any detectable performance issues.
Great question! If the problem is NEWSPAPER and NEWSPAPERS getting conflated, then a DICT_WORD_SIZE greater than 9 will fix the problem. If the problem is both words in NEWSPAPER CLIPPINGS being marked plural, then it won’t.
So that’s a good way to diagnose the problem! If it’s the latter, then that’s an exciting new bug in Inform that I haven’t come across before, and will need to be fixed as its own thing.
(The only real downside to increasing the limit is that the dictionary takes up more space, increasing the file size. But the storage space for a couple extra characters is negligible on modern machines, as is the processing time to compare longer strings. I actually don’t see any reason why I7 shouldn’t set a much higher default!)
Understand "newspaper" or "clipping" as a newspaper clipping.
…so it’s not like it loses you any intended synonyms.
The current version of I6 has an option which lets you tell whether a dict word was defined as plural, defined as non-plural, or both. (There’s two distinct flags, either or both of which can be set.) This lets the parser at least know whether 'newspaper' is definitely plural or ambiguously plural. Writing parser code to make use of this information is, of course, another kettle of fish.
There’s also a dict flag option which lets you tell whether a dict word 'newspaper' was ever seen in the source as 'newspapers' and then truncated. Of course you can’t tell what it was truncated from. Nor can you tell whether the word only appeared through truncation. I’m not sure if this is useful on top of the other flags, but the request made sense so I implemented it.
Um, you’ve already stated an extremely good reason why it should set a higher default though. If it’s not even high enough to handle words in the core world model, then that’s just ridiculous. Though I don’t really know how much higher it should be set…
On Z-machine it’s always 6 on earlier versions and 9 on later versions, yeah. DICT_WORD_SIZE only has an effect in Glulx, where there’s no built-in dictionary machinery; that’s all implemented in library code.
Back when we were playing z3 games and the limit was six characters, people fairly often took advantage of the automatic abbreviation recognition. Using READ HIEROG all the time in Infidel saved a fair amount of typing.
I don’t think I did it a lot once we got used to z5 and nine-character dict words, but I never entirely lost the habit either.
I don’t think losing this would be much of a downside, but somebody will notice and be annoyed about it. Once.
(That said, if I were implementing Infidel today, I’d add HIERO as a synonym!) (The ZIL source includes HIEROG explicitly, even though it doesn’t need to. Also SYMBOL and GLYPHS.)