I feel a bit silly bringing this up as I feel I really should know the answer, but apparently I had never before tried to use a noun ending in ‘s’ in Inform 7 that must occassionally be referred to in a possessive sense and now that I want to do so I’m at a loss for ideas. For example consider the following code:
[code]Include Plurality by Emily Short.
The testarea is a room.
A head is a kind of thing. One head is part of every person.
Some eyes are a kind of thing. One eyes are part of every head.
A woman called Doctor Janus is in the testarea.[/code]
When trying to interact with the Janus’ head or eyes in the above example, I immediately noticed that something needed to be done because:
a) Commands must be in the format “[command] janus’s head” to interact with her parts; for example “x janus’s head”;
b) Output text from Inform prints the possessive form of janus’ name in the format “janus’s”; for example the command “get janus’s eyes” results in the output text “Those seem to be a part of Doctor Janus’s head.”;
My immediate reaction on noticing this problem was to add the following command to address (a):
After reading a command:
let T be indexed text;
let T be the player's command;
replace the regular expression "janus'" in T with "janus's";
change the text of the player's command to T.
but that did absolutely nothing (compiled fine but no effect in-game); nor did:
After reading a command:
let T be indexed text;
let T be the player's command;
replace the regular expression "janus\'" in T with "janus\'s";
change the text of the player's command to T.
To address (b) I tried adding the following:
Doctor Janus is plural-named.
thinking this would hook into the “To say possessive for whatever when whatever acts plural” portion of the Plurality extension, but it didn’t work; neither did adding a more explicit statement:
To say possessive of Doctor Janus: say "Doctor Janus[apostrophe]"
to the source code.
In any case, none of this fiddling around would have addressed the general issue of how to properly use possessive nouns that end in ‘s’ (either in commands or in output text) since the fiddling was specific to ‘doctor janus.’ Does anyone have any suggestions on how to deal with this problem? At the moment I’m thinking I’ll just give the good doctor some other name that doesn’t end in ‘s’ and make a mental note to never again use any name that ends in ‘s’ that will need to be referred to in a possessive context, but that’s a cop-out rather than a solution; I’d prefer to think that possessive nouns ending in ‘s’ are just annoying rather than truly evil .
Thanks in advance for any suggestions.