Possessive Apostrophe

I think I heard that there was an extension for this, but I’m not sure what it does…

[code]“The Crux of the Biscuit”

The Town is a room.

John James Jingleheimer Schmidt is a man in the Town.

ears are a kind of thing. Some ears are a part of every person.
[/code]

It seems Inform is happy with your apostrophe as long as it comes where Inform put it, at the very end of a name. But if you use some other combination of words to name something, it doesn’t like your apostrophe. What should I do?

I just discovered something else weird about this situation, which involves object disambiguation. It seems that the parser has no problem disambiguating an object from its parts when it is in the location, but when the object is in a container, it has to ask:

[code]“The Wood for the Trees”

a head is a kind of thing. a head is a part of every person.

The Woods is a room.

the trap is an open container in the woods

A grizzly bear is a person in the trap

A whitetail deer is a person in the woods

test me with “x bear/x grizzly/x whitetail”[/code]

This seems to resolve this particular mystery:

Does the player mean doing something with a person when the person is in a container: It is very likely.

This issue is a bit of a mess. Simply saying “Some ears are a part of every person” creates an object called “[whatever the person’s name is]'s ears” – in this case “John Jacob Jingleheimer Schmidt’s ears,” and I do believe that’s the last time I’ll type that out in full – so “John’s ears” doesn’t work, because “John’s” isn’t a word in the name of the ears. Note that “x john ears” does work. Which is unsatisfactory, since we’d like to allow “John’s” to refer to parts of John, as well as synonyms (“x boy’s ears,” if “boy” is understood as a synonym for JJJS).

This bit of code gets at least part of the way there; it inserts a space before 's in any command, so the 's can be processed as a separate word, and then takes the “[name] 's” to refer to anything that the named thing encloses. (If you just want to refer to parts, you can change “enclosure” to “incorporation.”)

[code]After reading a command:
let X be indexed text;
let X be the player’s command;
replace the text “'s” in X with " [’]s";
change the text of the player’s command to X.

Understand “[something related by reversed enclosure] 's” as a thing.
Understand “my” as a thing when the player encloses the item
described.[/code]

But then some other potentially screwy stuff can happen. See the discussion around here; that’s where the bug comes in. You might also want to read some of the previous discussion (though the first piece of code I posted there was somewhat buggy on its own terms and also copied in wrong, and then Endosphere and I talked past each other for a while).

Here’s another relevant discussion; it seems that if you combine this with “The player is Sally” you get a whole bunch of new issues, thanks to the mysterious “yourself” object. And here’s a thread relevant to that (I think that’s the one with Endosphere’s solution to the problem mentioned in the previously linked thread.

…anyway, hopefully the first bit of code I posted is enough to get you started.

[Your second post went up while I was typing – that’s odd.]

See my note on Mantis inform7.com/mantis/view.php?id=162#c522 for some success in this area with output such as:

Welcome
An Interactive Fiction
Release 1 / Serial number 100907 / Inform 7 build 6E72 (I6/v6.31 lib 6/12N) SD

Lab
You can see a straw hat, a machine, Bob and Caitlin here.

test me
(Testing.)

[1] x bob’s hat
Which do you mean, the small red hat or the large red hat?

[2] small
You see nothing special about the small red hat.

[3] x bob’s machine
The machine is currently switched off.

[4] x it’s dial
Which do you mean, the speed dial or the frequency dial?

[5] speed
You see nothing special about the speed dial.

[6] bob, give me your hat
Which do you mean, the small red hat or the large red hat?

[7] small
Bob gives the small red hat to you.

[8] x nose
Which do you mean, Alice’s nose, Bob’s nose or Caitlin’s nose?

[9] my
You see nothing special about Alice’s nose.

[10] x nose
Which do you mean, Alice’s nose, Bob’s nose or Caitlin’s nose?

[11] his
You see nothing special about Bob’s nose.

[12] x nose
Which do you mean, Alice’s nose, Bob’s nose or Caitlin’s nose?

[13] caitlin’s
You see nothing special about Caitlin’s nose.

[14] take caitlin’s hat
(the straw hat)
Taken.

[15] give it to caitlin
You give the straw hat to Caitlin.

[16] x hat
Which do you mean, the large red hat, the straw hat, the small yellow hat, the large yellow hat, the small red hat or the blue hat?

[17] caitlin’s
Which do you mean, the straw hat, the small yellow hat or the large yellow hat?

[18] yellow
Which do you mean, the small yellow hat or the large yellow hat?

[19] large
You see nothing special about the large yellow hat.