Referring to parts of a person using "his" and "her"

I can’t work out how to do this, at least not in a way that doesn’t make “her” part of the noun.

For example, if I have Alice (a woman) wearing a coat, “Alice’s coat” and “her coat” will end up at the same thing.

If I make a part of Alice, on the other hand, “Alice’s nose” works, but “her nose” results in “I only understood as far as wanting to examine Alice.”

My first thought was to make parts of animate gendered things have the owner’s pronoun as an attribute that describes them. That works, but now Inform wants to disambiguate between “her nose” and “her” when I try something like “put the hat on her”.

Is there another way? Essentially I want the same behaviour that Inform has for referring to objects held by a creature to apply to parts of a creature.

You can do this:

[code]
Test Chamber is a room.

Understand “her” as a thing when the item described is part of a woman.
Understand “his” as a thing when the item described is part of a man.

A nose is a kind of thing. A nose is part of every person.

Alice and Darya are women in Test Chamber.
Alice carries a red pen. Darya carries a blue pen.
Bob and Chris are men in Test Chamber.

Test me with “x nose / x her nose / x his nose / x alice / x her / x her pen / x darya / x her / x her pen”.
[/code]but you won’t get quite the same behavior as with the built in “her” applied to carried objects, because the latter refers to the most recently referenced woman (see the “test me” output starting with “x alice”). There’s probably a way, but it would require tapping into how the standard rules track the antecedents of pronouns or doing your own tracking.

Edit: Here’s some sketchy code based off of a reading of ANNOUNCE_PRONOUN_MEANINGS_R in the generated I6 code.

Test Chamber is a room.

Understand "her" as a thing when the item described is part of a woman (called W) and W is the antecedent of her.
Understand "his" as a thing when the item described is part of a man (called M) and M is the antecedent of him.

To decide which thing is the antecedent of him:
	(- LanguagePronouns-->6 -)

To decide which thing is the antecedent of her:
	(- LanguagePronouns-->9 -)

A nose is a kind of thing. A nose is part of every person.

Alice and Darya are women in Test Chamber.
Alice carries a red pen. Darya carries a blue pen.
Bob and Chris are men in Test Chamber.

Test me with "x alice / x her nose / x darya / x her nose / x bob / x his nose / x chris / x his nose".

Edit 2: Here’s a longer and slightly less sketchy version. It doesn’t use hardcoded knowledge of the order of pronouns in LanguagePronouns, but it still uses knowledge of its general layout.

Test Chamber is a room.

Understand "her" as a thing when the item described is part of a woman (called W) and W is the antecedent of her.
Understand "his" as a thing when the item described is part of a man (called M) and M is the antecedent of him.

To decide which thing is the antecedent of him:
	(- GetHimAntecedent() -)

To decide which thing is the antecedent of her:
	(- GetHerAntecedent() -)

To set pronoun indices:
	(- SetPronounIndices(); -)

When play begins:
	set pronoun indices.

Include (-
Global him_index;
Global her_index;

[ SetPronounIndices x;
  for (x = 1: x <= LanguagePronouns-->0: x = x + 3) {
      if (LanguagePronouns-->x == 'him') {
          him_index = x + 2;
      } else if (LanguagePronouns-->x == 'her') {
          her_index = x + 2;
      }
  }
];

[ GetHimAntecedent;
  return LanguagePronouns-->him_index;
];

[ GetHerAntecedent;
  return LanguagePronouns-->her_index;
];
-).

A nose is a kind of thing. A nose is part of every person.

Alice and Darya are women in Test Chamber.
Alice carries a red pen. Darya carries a blue pen.
Bob and Chris are men in Test Chamber.

Test me with "x alice / x her nose / x darya / x her nose / x bob / x his nose / x chris / x his nose".

This is still an issue, but only for women (because the accusative and possessive pronouns are the same: her and her, unlike for men: him vs. his) and only under certain circumstances. See my post below for more on this.

Wow, thank you so much, this works really well (and is well beyond my capabilities).

A little bit more on the disambiguation issue.

[rant=test program][code]
Test Chamber is a room.

Understand “her” as a thing when the item described is part of a woman (called W) and W is the antecedent of her.

To decide which thing is the antecedent of her:
(- LanguagePronouns–>9 -)

A nose is a kind of thing. A nose is part of every person.
[A head is a kind of thing. A head is part of every person.]

Alice and Darya are women in Test Chamber.
Alice carries a red pen.
[Darya carries a blue pen.]
[Alice wears a red hat.]
[Darya wears a blue hat.]

Test me with “x alice / x her nose / x her / x darya / x her nose / x her”.
[/code][/rant]
The parser deals with “x her” by performing two parsing passes.

The first pass looks for a match in “indefinite mode” with owner = the antecedent of “her”. This pass treats “her” as a possessive and looks for stuff that belongs to the woman. Unfortunately, the parser’s notion of ownership is solely based on containment. So, if a person is carrying or wearing an object, they own it. However, if the object is part of them, the parser doesn’t consider this to be ownership and fails to make a match. (You can read a lengthy message that I posted about this issue in the context of parsing “my arms” here.) So, in our example, pens are matched during this pass, but noses are not.

The second pass looks for a match in “definite mode”. This pass treats “her” as an object rather than a possessive and, in our example, matches both the woman and her nose. (The nose is matched because of the understand statement that we wrote.)

In the end, the woman edges out the nose and the pen in the parser’s scoring routine because she’s in the player’s location while the other objects aren’t.

So we have:

Case 1: woman with pen
indefinite matches: pen
definite matches: woman (best match), nose
The parser decides on woman and no parenthetical msg is printed.

Case 2: woman without pen
indefinite matches: nothing
definite matches: woman (best match), nose
The parser decides on woman and does print a parenthetical msg.

I’ve run some other tests (giving women various combos of component parts and carried possessions), and it seems that we only avoid the disambiguation msg for “x her” if exactly one of multiple matches is an indefinite match.

Conclusions:

  • The one indefinite match case is special. Why?
  • The parser’s notion of ownership should include parts of people.

This whole thread is over my head, so I’ll just quote Emily here:

If no one wants to discuss this here in this thread (and apparently no one does) it might as well be filed somewhere; it does seem to merit filing.

Issue 1909.

I also made it a uservoice suggestion (here).