TIActionclass
Transitive-with-indirect Action class - this is an action that takes both a direct and indirect object. We subclass the basic one-object action to add the indirect object handling.
Modified in
en_us.t[8600]:
English-specific additions for two-object verbs.
class
TIAction
:
TAction
Superclass Tree (in declaration order)
TIAction
TAction
Action
BasicProd
` object
[
Resolver](../object/Resolver.html)
object`
Subclass Tree
TIAction
AttachToAction
predicate(AttachTo)
predicate(AttachToWhat)
AttackWithAction
predicate(AttackWith)
BurnWithAction
predicate(BurnWith)
CleanWithAction
predicate(CleanWith)
CutWithAction
predicate(CutWith)
predicate(CutWithWhat)
DetachFromAction
predicate(DetachFrom)
DigWithAction
predicate(DigWith)
FastenToAction
predicate(FastenTo)
GiveToAction
predicate(GiveTo)
predicate(GiveToType2)
predicate(GiveToWhom)
LockWithAction
predicate(LockWith)
MoveToAction
predicate(MoveTo)
MoveWithAction
predicate(MoveWith)
PlugIntoAction
predicate(PlugInto)
predicate(PlugIntoWhat)
PourIntoAction
predicate(PourInto)
PourOntoAction
predicate(PourOnto)
PushTravelViaIobjAction
PushTravelClimbDownAction
predicate(PushTravelClimbDown)
PushTravelClimbUpAction
predicate(PushTravelClimbUp)
PushTravelEnterAction
predicate(PushTravelEnter)
PushTravelGetOutOfAction
predicate(PushTravelGetOutOf)
PushTravelThroughAction
predicate(PushTravelThrough)
PutBehindAction
predicate(PutBehind)
PutInAction
predicate(PutIn)
predicate(PutInWhat)
PutOnAction
predicate(PutOn)
PutUnderAction
predicate(PutUnder)
ScrewWithAction
predicate(ScrewWith)
ShowToAction
predicate(ShowTo)
predicate(ShowToType2)
predicate(ShowToWhom)
TakeFromAction
predicate(TakeFrom)
ThrowAtAction
predicate(ThrowAt)
ThrowToAction
predicate(ThrowTo)
predicate(ThrowToType2)
TurnWithAction
predicate(TurnWith)
UnfastenFromAction
predicate(UnfastenFrom)
UnlockWithAction
predicate(UnlockWith)
UnplugFromAction
predicate(UnplugFrom)
UnscrewWithAction
predicate(UnscrewWith)
Global Objects
(none)
Summary of Properties
actionIobjProp
askIobjResponseProd
checkIobjProp
execFirst
iobjCur_
iobjInfoCur_
iobjList_
iobjMatch
iobjResolver_
isPrepositionalPhrasing
lastObjList_
needAnaphoricBinding_
omitIobjInDobjQuery
preCondIobjProp
predicateNounPhrases
remapIobjProp
resolveFirst
resolveFirstEmpty
tentativeDobj_
tentativeIobj_
verIobjProp
Inherited from TAction
:
actionAllowsAll
actionDobjProp
actor_
askDobjResponseProd
checkDobjProp
dobjCur_
dobjInfoCur_
dobjList_
dobjMatch
dobjResolver_
issuer_
preCondDobjProp
remapDobjProp
verDobjProp
whichMessageObject
Inherited from Action
:
actionTime
afterActionMainList
beforeAfterObjs
defaultForRecursion
extraMessageParams
implicitMsg
includeInUndo
isImplicit
isRepeatable
iterationCanceled
originalAction
parentAction
preCond
pronounOverride
remappedFrom
showDefaultReports
synthParamID
verbFlags
verifiedOkay
Inherited from BasicProd
:
firstTokenIndex
isSpecialResponseMatch
lastTokenIndex
Inherited from Resolver
:
action_
equivs_
isGlobalScope
isSubResolver
scope_
whichObject
Summary of Methods
announceAllDefaultObjects
announceDefaultObject
canIobjResolveTo
checkAction
checkRemapping
copyTentativeObjs
createForMissingIobj
createIobjResolver
doActionMain
execAction
filterAmbiguousIobj
filterPluralIobj
getAllIobj
getAnaphoricBinding
getCurrentObjects
getDefaultIobj
getIobj
getIobjCount
getIobjFlags
getIobjInfo
getIobjResolver
getIobjTokens
getIobjWords
getMatchForRole
getMessageParam
getObjectForRole
getObjResponseProd
getOtherMessageObjectPronoun
getOtherObjectRole
getPreCondDescList
getPreCondPropForRole
getQuestionInf
getRemapPropForRole
getResolvedIobjList
getResolvedObjList
getResolveInfo
getRoleFromIndex
getTentativeDobj
getTentativeIobj
getVerbPhrase
getVerbPhrase2
getVerifyPropForRole
initForMissingDobj
initForMissingIobj
initTentative
needRemappedAnnouncement
resetAction
resolvedObjectsInScope
resolveNouns
retryWithAmbiguousIobj
retryWithMissingIobj
setCurrentObjects
setObjectMatches
setPronounByInput
setResolvedIobj
setResolvedObjects
testRetryDefaultIobj
verifyAction
whatObj
Inherited from TAction
:
adjustDefaultObjectPrep
canDobjResolveTo
construct
createDobjResolver
createForMissingDobj
createForRetry
filterAmbiguousDobj
filterPluralDobj
getAllDobj
getDefaultDobj
getDobj
getDobjCount
getDobjFlags
getDobjInfo
getDobjResolver
getDobjTokens
getDobjWords
getResolvedDobjList
getVerbPhrase1
initResolver
retryWithAmbiguousDobj
retryWithMissingDobj
setResolvedDobj
testRetryDefaultDobj
Inherited from Action
:
actionOfKind
addBeforeAfterObj
afterAction
afterActionMain
announceActionObject
beforeAction
beforeActionMain
cacheMultiObjectAnnouncements
callAfterActionMain
callCatchAllProp
callPreConditions
callVerifyPreCond
callVerifyProp
cancelIteration
checkPreConditions
combineRemappedVerifyResults
createActionFrom
createActionInstance
createTopicQualifierResolver
doAction
doActionOnce
filterAmbiguousWithVerify
filterFacets
filterPluralWithVerify
finishResolveList
getDefaultWithVerify
getEnteredVerbPhrase
getImplicitPhrase
getInfPhrase
getNotifyTable
getObjPreCondDescList
getObjPreConditions
getOriginalAction
getOrigTokenList
getParticiplePhrase
getPredicate
getPronounOverride
getRemappedFrom
getSimpleSynonymRemap
getSortedVerifyResults
isConversational
isNestedIn
isPartOf
isRemapped
makeResolveInfo
makeResolveInfoList
maybeAnnounceDefaultObject
maybeAnnounceImplicit
maybeAnnounceMultiObject
noMatch
notifyBeforeAfter
objListPronoun
preAnnounceActionObject
recalcSenseContext
repeatAction
resolveAction
runBeforeNotifiers
saveActionForAgain
setImplicit
setMessageParam
setMessageParams
setNested
setOriginalAction
setPronounOverride
setRemapped
spPrefix
spSuffix
synthMessageParam
verifyHandlersExist
whatTranslate
withVerifyResults
zeroActionTime
Inherited from BasicProd
:
canResolveTo
getOrigText
setOrigTokenList
Inherited from Resolver
:
allowAll
cacheScopeList
filterAll
filterAmbiguousEquivalents
filterAmbiguousNounPhrase
filterPluralPhrase
filterPossRank
getAction
getAll
getAllDefaults
getDefaultObject
getPossessiveResolver
getPronounDefault
getQualifierResolver
getRawPronounAntecedent
getReflexiveBinding
getScopeList
getTargetActor
matchName
objInScope
resetResolver
resolvePronounAntecedent
resolveUnknownNounPhrase
selectIndefinite
withGlobals
Properties
actionIobjProp
no description available
askIobjResponseProd
The root production to use to parse missing indirect object responses. By default, this is singleNoun, but individual actions can override this as appropriate.
Note that language modules might want to override this to allow for special responses. For example, in English, most verbs will want to override this with a specialized production that allows the appropriate preposition in the response.
checkIobjProp
no description available
execFirst
Determine which object to call first for action processing. By default, we execute in the same order as we resolve, but this can be overridden if necessary.
iobjCur_
current indirect object being executed
iobjInfoCur_
the full ResolveInfo associated with iobjCur_
iobjList_
the indirect object list
iobjMatch
the predicate grammar must assign the indirect object production tree to iobjMatch
iobjResolver_
my cached indirect object resolver
isPrepositionalPhrasing
For VerbRules: does this verb rule have a prepositional or structural phrasing of the direct and indirect object slots? That is, are the object slots determined by a prepositional marker, or purely by word order? For most English verbs with two objects, the indirect object is marked by a preposition: GIVE BOOK TO BOB, PUT BOOK IN BOX. There are a few English verbs that don’t include any prespositional markers for the objects, though, and assign the noun phrase roles purely by the word order: GIVE BOB BOOK, SHOW BOB BOOK, THROW BOB BOOK. We define these phrasings with separate verb rules, which we mark with this property.
We use this in ranking verb matches. Non-prepositional verb structures are especially prone to matching where they shouldn’t, because we can often find a way to pick out words to fill the slots in the absence of any marker words. For example, GIVE GREEN BOOK could be interpreted as GIVE BOOK TO GREEN, where GREEN is assumed to be an adjective-ending noun phrase; but the player probably means to give the green book to someone who they assumed would be filled in as a default. So, whenever we find an interpretation that involves a non-prespositional phrasing, we’ll use this flag to know we should be suspicious of it and try alternative phrasing first.
Most two-object verbs in English use prepositional markers, so we’ll set this as the default. Individual VerbRules that use purely structural phrasing should override this.
lastObjList_
The last object list we resolved. We keep track of this so that we can provide it as the anaphoric binding, if an anaphor binding is requested.
needAnaphoricBinding_
Flag: we have been asked for an anaphoric binding, but we don’t have a binding available. We’ll check this after resolving the first-resolved noun phrase so that we can go back and re-resolve it again after resolving the other noun phrase.
omitIobjInDobjQuery
Flag: omit the indirect object in a query for a missing direct object. For many verbs, if we already know the indirect object and we need to ask for the direct object, the query sounds best when it includes the indirect object: “what do you want to put in it?” or “what do you want to take from it?”. This is the default phrasing.
However, the corresponding query for some verbs sounds weird: “what do you want to dig in with it?” or “whom do you want to ask about it?”. For such actions, this property should be set to true to indicate that the indirect object should be omitted from the queries, which will change the phrasing to “what do you want to dig in”, “whom do you want to ask”, and so on.
preCondIobjProp
no description available
predicateNounPhrases
OVERRIDDEN
we have a direct and indirect object
remapIobjProp
Action-remap properties for the indirect object. By convention, the remapper properties are named remapDobjAction and remapIobjAction, for the direct and indirect objects, respectively, where Action is replaced by the root name of the action.
resolveFirst
Resolution order - returns DirectObject or IndirectObject to indicate which noun phrase to resolve first in resolveNouns(). By default, we’ll resolve the indirect object first, but individual actions can override this to resolve in a non-default order.
resolveFirstEmpty
Empty phrase resolution order. This is similar to the standard resolution order (resolveFirst), but is used only when both the direct and indirect objects are empty phrases.
When both phrases are empty, we will either use a default or prompt interactively for the missing phrase. In most cases, it is desirable to prompt interactively for a missing direct object first, regardless of the usual resolution order.
tentativeDobj_
The tentative direct and indirect object lists. A tentative list is available for the later-resolved object while resolving the earlier-resolved object.
tentativeIobj_
no description available
verIobjProp
Verification and action properties for the indirect object. By convention, the verification method for the indirect object of a two-object action is verIobjXxx; the check method is checkIobjXxx; and the action method is actionIobjXxx.
Methods
announceAllDefaultObjects (allResolved)
OVERRIDDEN
announce all defaulted objects
announceDefaultObject (obj, whichObj, resolvedAllObjects)
OVERRIDDEN
announce a default object used with this action
canIobjResolveTo (obj)
Can the indirect object potentially resolve to the given simulation object? This only determines if the object is a *syntactic* match, meaning that it can match at a vocabulary and grammar level. This doesn’t test it for logicalness or check that it’s an otherwise valid resolution.
checkAction ( )
OVERRIDDEN
Check the command.
For a two-object action, this first calls the catch-all ‘check’ methods (the dobjFor(Default) and dobjFor(All) methods) on the two objects (indirect object first), then calls the ‘check’ methods for this specific action (direct object first).
checkRemapping ( )
OVERRIDDEN
Check for remapping
copyTentativeObjs ( )
Copy one tentative object list to the other. This is useful when an object’s verifier for one TIAction wants to forward the call to the other object verifier for a different TIAction.
createForMissingIobj (orig, asker)
Create an instance of this action for retrying a given single-object action with a missing indirect object.
createIobjResolver (issuingActor, targetActor)
Create our indirect object resolver. By default, we’ll use a basic indirect object resolver.
doActionMain ( )
OVERRIDDEN
Execute the action. We’ll run through the execution sequence once for each resolved object in our direct or indirect object list, depending on which one is the list and which one is the singleton.
execAction ( )
OVERRIDDEN
Execute the command.
filterAmbiguousIobj (lst, requiredNum, np)
filter an ambiguous indirect object noun phrase
filterPluralIobj (lst, np)
filter a plural phrase
getAllIobj (actor, scopeList)
Resolve ‘all’ for the indirect object. By default, we’ll return everything in the scope list.
getAnaphoricBinding (typ)
OVERRIDDEN
Get the anaphoric binding for the noun phrase we’re currently resolving.
getCurrentObjects ( )
OVERRIDDEN
Get the list of active objects. We have a direct and indirect object.
getDefaultIobj (np, resolver)
get the default indirect object
getIobj ( )
get the current indirect object being executed
getIobjCount ( )
get the number of direct objects
getIobjFlags ( )
get the object resolution flags for the indirect object
getIobjInfo ( )
get the full ResolveInfo associated with the current indirect object
getIobjResolver (issuingActor, targetActor, reset)
get our indirect object resolver, or create one if we haven’t already cached one
getIobjTokens ( )
get the original token list of the current indirect object phrase
getIobjWords ( )
get the original words (as a list of strings) of the current iobj
getMatchForRole (role)
OVERRIDDEN
get the match tree for the noun phrase in the given role
getMessageParam (objName)
OVERRIDDEN
Get a message parameter object for the action. We define ‘dobj’ as the direct object and ‘iobj’ as the indirect object, in addition to any inherited targets.
getObjectForRole (role)
OVERRIDDEN
get the resolved object in a given role
getObjResponseProd (resolver)
OVERRIDDEN
get the missing object response production for a given role
getOtherMessageObjectPronoun (which)
Get the pronoun for the message object in the given role.
getOtherObjectRole (role)
OVERRIDDEN
get the OtherObject role for the given role
getPreCondDescList ( )
OVERRIDDEN
get the precondition descriptor list for the action
getPreCondPropForRole (role)
OVERRIDDEN
get the ‘preCond’ property for a given object role
getQuestionInf (which)
OVERRIDDEN
show the verb’s basic infinitive form for an interrogative
getRemapPropForRole (role)
OVERRIDDEN
get the ‘remap’ property for a given object role
getResolvedIobjList ( )
get the list of resolved indirect objects
getResolvedObjList (which)
OVERRIDDEN
get the list of resolved objects in the given role
getResolveInfo (obj, oldRole)
OVERRIDDEN
get the ResolveInfo for the given resolved object
getRoleFromIndex (idx)
OVERRIDDEN
get an object role
getTentativeDobj ( )
Get the tentative direct/indirect object resolution lists. A tentative list is available for the later-resolved object while resolving the earlier-resolved object.
getTentativeIobj ( )
no description available
getVerbPhrase (inf, ctx)
OVERRIDDEN
get the verb phrase in infinitive or participle form
getVerbPhrase2 (inf, vp, dobjText, dobjIsPronoun, iobjText)
Get the verb phrase for a two-object (dobj + iobj) phrasing. This is a class method, so that it can be reused by unrelated (i.e., non-TIAction) classes that also use two-object syntax but with other internal structures. This is the two-object equivalent of TAction.getVerbPhrase1().
getVerifyPropForRole (role)
OVERRIDDEN
get the ‘verify’ property for a given object role
initForMissingDobj (orig)
OVERRIDDEN
Initialize the action for retrying with a missing direct object.
If we’re trying a TIAction, we can only be coming from a TAction (since that’s the only kind of original action that can turn into a two-object, at least in the base library). That means the original action already has a direct object. Now, since we’re asking for a MISSING direct object, the only possibility is that the original action’s direct object is our INDIRECT object. For example: SWEEP WITH BROOM is turning into SWEEP <what> WITH BROOM.
initForMissingIobj (orig)
Initialize the action for retrying with a missing indirect object.
We can only be coming from a TAction, so the TAction will have a direct object already. Simply copy that as our own direct object. For example: UNLOCK DOOR is turning into UNLOCK DOOR WITH <what>.
initTentative (issuingActor, targetActor, whichObj)
OVERRIDDEN
initialize tentative resolutions for other noun phrases
needRemappedAnnouncement (info)
Determine if we need to announce this action when the action was remapped, based on the resolution information for one of our objects. We need to announce a remapped action when either object had unclear disambiguation or was defaulted.
resetAction ( )
OVERRIDDEN
no description available
resolvedObjectsInScope ( )
OVERRIDDEN
check that the resolved objects are in scope
resolveNouns (issuingActor, targetActor, results)
OVERRIDDEN
resolve our noun phrases to objects
Modified in
en_us.t[8649]:
resolve noun phrases
retryWithAmbiguousIobj (orig, objs, asker, objPhrase)
Retry an action as a two-object action with an ambiguous indirect object. We’ll ask which of the given possible objects is intended.
retryWithMissingIobj (orig, asker)
Retry a single-object action as a two-object action. We’ll treat the original action’s direct object list as our direct object list, and obtain an indirect object using the normal means (first looking for a default, then prompting the player if we can’t find a suitable default). ‘orig’ is the original single-object action.
This routine terminates with ‘exit’ if it doesn’t throw some other error.
setCurrentObjects (lst)
OVERRIDDEN
set the current objects
setObjectMatches (dobj, iobj)
OVERRIDDEN
manually set the unresolved object noun phrase match trees
setPronounByInput (lst)
Set the pronoun according to the pronoun type actually used in the input. For example, if we said PUT BOX ON IT, we want IT to continue referring to whatever IT referred to before this command - we specifically do NOT want IT to refer to the BOX in this case.
setResolvedIobj (iobj)
set a resolved iobj
setResolvedObjects (dobj, iobj)
OVERRIDDEN
Manually set the resolved objects. We’ll set our direct and indirect objects.
testRetryDefaultIobj (orig)
Test to see if askForIobj() would find a default indirect object. Returns true if there’s a default, nil if not. If this returns true, then askForIobj() will simply take the default and proceed; otherwise, it will have to actually ask the user for the missing information.
verifyAction ( )
OVERRIDDEN
Verify the action.
whatObj (which)
OVERRIDDEN
get the interrogative for one of our objects
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3