intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Dec 16, 2017 12:24 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Apr 12, 2016 5:03 pm 
Offline

Joined: Tue Apr 12, 2016 4:43 pm
Posts: 4
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Apr 12, 2016 9:41 pm 
Offline

Joined: Sat Dec 26, 2015 7:34 pm
Posts: 517
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".
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.
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.
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:
   (- 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".

Stephen wrote:
now Inform wants to disambiguate between "her nose" and "her"

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.

_________________
Vince Laviano


Last edited by vlaviano on Wed Apr 13, 2016 5:19 am, edited 3 times in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Apr 13, 2016 2:00 am 
Offline

Joined: Tue Apr 12, 2016 4:43 pm
Posts: 4
Wow, thank you so much, this works really well (and is well beyond my capabilities).


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Apr 13, 2016 5:16 am 
Offline

Joined: Sat Dec 26, 2015 7:34 pm
Posts: 517
A little bit more on the disambiguation issue.

test program : show
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".

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.

_________________
Vince Laviano


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 02, 2016 12:01 pm 
Offline

Joined: Tue Aug 12, 2014 7:56 pm
Posts: 1668
vlaviano wrote:
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:

Quote:
This is complicated but also seems not super-urgent. I think you could probably make a case for either Mantis or UserVoice for the “notion of ownership” issue; whatever gets filed, it would be great to have it point back to this thread.


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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 02, 2016 2:29 pm 
Offline

Joined: Sat Dec 26, 2015 7:34 pm
Posts: 517
Peter Piers wrote:
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.

_________________
Vince Laviano


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jun 23, 2016 2:39 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 721
Location: Malmö, Sweden
I also made it a uservoice suggestion (here).

_________________
~Björn Paulsen


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group