intfiction.org

The Interactive Fiction Community Forum
It is currently Sat May 25, 2013 7:49 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Jul 28, 2012 12:17 am 
Offline

Joined: Sun Jan 30, 2011 10:20 pm
Posts: 32
Suppose I have two identical objects in nearly every way in the same room, their only distinction being who they belong to. Like this overly simplistic example, for instance:

Code:
Dad: Actor 'Dad' 'Dad' @startRoom
    "It's dad"
;

+ apples1: Possession 'apple*apples/fruit*fruits' 'apples'
    "They're dad's apples"
    vocabLikelihood = 2
    isPlural = true
;

Mom: Actor 'mom' 'Mom' @startRoom
    "It's mom"
;

+ apples2: Possession 'apple*apples/fruit*fruits' 'apples'
    "They're mom's apples"
    vocabLikelihood = 1
    isPlural = true
;


For arbitrary reasons I won’t go into, Dad’s apples are important, while Mom’s are not. I want every command that refers to any of the vocab words to refer to Dad’s apples, UNLESS the player specifically qualifies his command as referring to Mom’s, in which case I want him to allow him to do the same things he can do with Dad’s apples (Thus Mom’s apples cannot be a Decoration).

I short, I want commands like "x apples" to refer to apples1 only, instead of listing both apples1 and apples2's descriptions.

Setting vocabLikelihood like the example shows does what I want for the singular vocab words ("x apple" returns only apples1's desc), but the plural ones refer to both, even though I’d like for mom’s apples to not be referred to unless the player specifically specifies them. Is there some way to do this, or will the parser always give priority to all objects who fit a command in plural?


Top
 Profile Send private message  
 
PostPosted: Sun Aug 05, 2012 11:41 am 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
Arag-e wrote:
Setting vocabLikelihood like the example shows does what I want for the singular vocab words ("x apple" returns only apples1's desc), but the plural ones refer to both, even though I’d like for mom’s apples to not be referred to unless the player specifically specifies them. Is there some way to do this, or will the parser always give priority to all objects who fit a command in plural?


The parser will always return all objects that match a plural. The simplest approach is to not actually mark the vocabulary as plural:

Code:
Dad: Actor 'Dad' 'Dad'
    "It's dad"
;

+ apples1: Possession 'apple/fruit/apples/fruits' 'apples'
    "They're dad's apples"
    vocabLikelihood = 2
    isPlural = true
;

Mom: Actor 'mom' 'Mom'
    "It's mom"
;

+ apples2: Possession 'apple/fruit/apples/fruits' 'apples'
    "They're mom's apples"
    vocabLikelihood = 1
    isPlural = true
    dobjFor(Default) { verify() { nonObvious; } }
;


Which works in this simplistic case, but may not if you actually want the plural-matching behavior to find all matching objects except for Mom's - if brother and sister had apples as well, say.

Another option is to set up the vocabulary for Mom's apples like this:

Code:
apples2: Possession 'mom\'s apple/fruit*apples fruits' 'apples'
    "They're mom's apples"
    isPlural = true
    weakTokens = ['apple', 'fruit', 'apples', 'fruits']
;


Which is sort of backwards but does the job, at the cost of "x mom's" referring to the apples (since the possessive adjective is the only strong vocabWord in the list.)


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


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