TopicResolverclass
Topic Resolver
class
TopicResolver
:
Resolver
Superclass Tree (in declaration order)
TopicResolver
Resolver
` object`
Subclass Tree
TopicResolver
ConvTopicResolver
TActionTopicResolver
Global Objects
(none)
Summary of Properties
isGlobalScope
qualifierResolver_
topicProd
Inherited from Resolver
:
action_
actor_
equivs_
isSubResolver
issuer_
scope_
whichMessageObject
whichObject
Summary of Methods
construct
filterAmbiguousNounPhrase
filterPluralPhrase
filterPossRank
getAll
getAllDefaults
getDefaultObject
getPossessiveResolver
getQualifierResolver
noMatch
noMatchPoss
noVocabMatch
objInPhysicalScope
objInScope
packageTopicList
resetResolver
resolveTopic
resolveUnknownNounPhrase
Inherited from Resolver
:
allowAll
cacheScopeList
filterAll
filterAmbiguousEquivalents
getAction
getPronounDefault
getRawPronounAntecedent
getReflexiveBinding
getScopeList
getTargetActor
matchName
resolvePronounAntecedent
selectIndefinite
withGlobals
Properties
isGlobalScope
OVERRIDDEN
our scope is global, because we don’t limit the scope to the physical senses
qualifierResolver_
our qualifier resolver
topicProd
the production match tree for the topic phrase we’re resolving
Methods
construct (action, issuingActor, targetActor, prod, which, qualifierResolver)
OVERRIDDEN
no description available
filterAmbiguousNounPhrase (lst, requiredNum, np)
OVERRIDDEN
Filter an ambiguous noun list.
It is almost always undesirable from a user interface perspective to ask for help disambiguating a topic phrase. In the first place, since all topics tend to be in scope all the time, we might reveal too much about the inner model of the story if we were to enumerate all of the topic matches to a phrase. In the second place, topics are used in conversational contexts, so it almost never make sense for the parser to ask for clarification - the other member of the conversation might ask, but not the parser. So, we’ll always filter the list to the required number, even if it means we choose arbitrarily.
As a first cut, we prefer objects that are physically in scope to those not in scope: if the player is standing next to a control panel and types “ask bob about control panel,” it makes little sense to consider any other control panels in the simulation.
As a second cut, we’ll ask the actor to filter the list. Games that keep track of the actor’s knowledge can use this to filter according to topics the actor is likely to know about.
filterPluralPhrase (lst, np)
OVERRIDDEN
filter a plural
filterPossRank (lst, num)
OVERRIDDEN
Filter an ambiguous noun phrase list using the strength of possessive qualification, if any. For a topic phrase, we want to keep all of the possibilities.
getAll (np)
OVERRIDDEN
we don’t allow ALL or provide defaults
getAllDefaults ( )
OVERRIDDEN
no description available
getDefaultObject (np)
OVERRIDDEN
get a default object
getPossessiveResolver ( )
OVERRIDDEN
no description available
getQualifierResolver ( )
OVERRIDDEN
get our qualifier resolver
noMatch (action, txt)
no description available
noMatchPoss (action, txt)
no description available
noVocabMatch (action, txt)
it’s fine not to match a topic phrase
objInPhysicalScope (obj)
Determine if an object is in physical scope. We’ll accept anything that’s in physical scope, and we’ll also accept any topic object that the actor knows about.
Note that this isn’t part of the basic Resolver interface. It’s instead provided as a service routine for our subclasses, so that they can easily determine the physical scope of an object if needed.
objInScope (obj)
OVERRIDDEN
Determine if the object is in scope. We consider any vocabulary match to be in scope for the purposes of a topic phrase, since the subject matter of topics is mere references to things, not the things themselves; we can, for example, ASK ABOUT things that aren’t physically present, or even about completely abstract ideas.
packageTopicList (lst, match)
package a resolved topic list - if it’s not already represented as a ResolvedTopic object, we’ll apply that wrapping
resetResolver ( )
OVERRIDDEN
remember the resolver for qualifier phrases
resolveTopic (lst, requiredNum, np)
Resolve the topic phrase. This returns a ResolvedTopic object encapsulating the resolution of the phrase.
This default base class implementation simply creates a resolved topic list with the whole set of possible matches undifferentiated. Subclasses for specialized actions might want to differentiate the items in the list, based on things like the actor’s knowledge so far or what’s in physical scope.
resolveUnknownNounPhrase (tokList)
OVERRIDDEN
Resolve an unknown phrase. We allow unknown words to be used in topics; we simply return a ResolvedTopic that doesn’t refer to any simulation objects at all.
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3