VerbProductionclass | parser.t[3957], grammar.t[3678]

VerbProduction is a special Production subclass for verb (predicate) rules. This production has special processing for building out the object phrases making up the verb.

Each instance should have an 'action' property giving the Action object associated with the verb rule. This is the Action that will be performed when the parser matches the command input to the rule.

Some languages, such as English, have "positional" predicate grammars. This means that the position of a noun phrase in the sentence determines its role (direct object, indirect object, etc). In the grammar for a positional language, each predicate rule simply needs to plug in a singleNoun or nounList production (as appropriate) in each noun phrase position, with its '->' property set to correspond to the role: ->dobjMatch for a direct object, ->iobjMatch for an indirect object, and ->accMatch for an accessory object.

Some languages, such as German and Latin, identify the role of a noun phrase using grammatical case. This means that the articles change form in the different roles, or that the nouns themselves are inflected (they have different forms, such as added suffixes) according to role. Case languages tend to have flexible predicate word order, because the case markers tell you the role of each noun even if the nouns are rearranged. For this reason, it can be tedious to write a grammar for a case language the way we do for English, where the word ordering for a given verb is so rigid that we can easily just write out each possible phrasing manually. For a case language, you'll probably instead want to write a set of generic verb rules that cover *all* verbs (i.e., you leave the verb word itself as a sub-production) in all of the different word orders, and use the case tagging in the language to determine the role of each noun phrase. For this style of grammar, the grammar must set the property nounPhraseRole in the top-level rule for each noun phrase case; set this to DirectObject, IndirectObject, AccessoryObject, etc., according to the role denoted by the case.

Still other languages, such as Japanese, use particles (grammar function words) to denote the role of each noun phrase in the sentence. This is similar to grammatical case, but the role information is encoded in separate words (the particles) rather than in noun affixes, so the nouns themselves aren't inflected. You can handle this type of language roughly the same way you'd handle a case language. Create generic rules that cover all verbs, then create a grammar rule for each particle-plus-noun structure. In each particle-plus-noun phrase's top-level rule, set the nounPhraseRole property to the appropriate role object (DirectObject, etc).

Modified in grammar.t[3678]:
English-specific VerbProduction additions

`class VerbProduction : Production`

Superclass Tree (in declaration order)

`VerbProduction`
`Production`
`object`

Subclass Tree

`VerbProduction`
`defaultVerbPhrase(noun)`
`EnTravelVia`
`VerbRule(About)`
`VerbRule(Again)`
`VerbRule(AskAbout)`
`VerbRule(AskAboutImplicit)`
`VerbRule(AskAboutWhat)`
`VerbRule(AskFor)`
`VerbRule(AskForImplicit)`
`VerbRule(AskVague)`
`VerbRule(AskWhomFor)`
`VerbRule(Attach)`
`VerbRule(AttachTo)`
`VerbRule(Attack)`
`VerbRule(AttackWith)`
`VerbRule(AuxQuery)`
`VerbRule(Board)`
`VerbRule(Break)`
`VerbRule(Brief)`
`VerbRule(Burn)`
`VerbRule(BurnWith)`
`VerbRule(Clean)`
`VerbRule(CleanWith)`
`VerbRule(Climb)`
`VerbRule(ClimbDown)`
`VerbRule(ClimbDownWhat)`
`VerbRule(ClimbUp)`
`VerbRule(ClimbUpWhat)`
`VerbRule(Close)`
`VerbRule(CmdMenu)`
`VerbRule(ConsultAbout)`
`VerbRule(ConsultWhatAbout)`
`VerbRule(Continue)`
`VerbRule(Credits)`
`VerbRule(Cut)`
`VerbRule(CutWith)`
`VerbRule(Debug)`
`VerbRule(DebugI)`
`VerbRule(Detach)`
`VerbRule(DetachFrom)`
`VerbRule(Dig)`
`VerbRule(DigWith)`
`VerbRule(Doff)`
`VerbRule(Drink)`
`VerbRule(Drop)`
`VerbRule(Eat)`
`VerbRule(Enter)`
`VerbRule(EnterOn)`
`VerbRule(Evaluate)`
`VerbRule(Examine)`
`VerbRule(Exits)`
`VerbRule(ExitsColour)`
`VerbRule(ExitsMode)`
`VerbRule(Extinguish)`
`VerbRule(ExtraHints)`
`VerbRule(Fasten)`
`VerbRule(FastenTo)`
`VerbRule(Feel)`
`VerbRule(FiatLux)`
`VerbRule(Flip)`
`VerbRule(Follow)`
`VerbRule(Footnote)`
`VerbRule(FootnotesFull)`
`VerbRule(FootnotesMedium)`
`VerbRule(FootnotesOff)`
`VerbRule(FootnotesStatus)`
`VerbRule(FullScore)`
`VerbRule(GetOff)`
`VerbRule(GetOut)`
`VerbRule(GetOutOf)`
`VerbRule(GiveTo)`
`VerbRule(GiveToImplicit)`
`VerbRule(GiveToType2)`
`VerbRule(GoAlong)`
`VerbRule(GoBack)`
`VerbRule(GoNear)`
`VerbRule(Goodbye)`
`VerbRule(GoSomewhere)`
`VerbRule(GoThrough)`
`VerbRule(GoTo)`
`VerbRule(Hello)`
`VerbRule(Help)`
`VerbRule(Hints)`
`VerbRule(HintsOff)`
`VerbRule(In)`
`VerbRule(instructions)`
`VerbRule(Intro)`
`VerbRule(Inventory)`
`VerbRule(InventoryTall)`
`VerbRule(InventoryWide)`
`VerbRule(Jump)`
`VerbRule(JumpOff)`
`VerbRule(JumpOffIntransitive)`
`VerbRule(JumpOver)`
`VerbRule(KeepGoing)`
`VerbRule(Kiss)`
`VerbRule(Lie)`
`VerbRule(LieIn)`
`VerbRule(LieOn)`
`VerbRule(Light)`
`VerbRule(Listen)`
`VerbRule(ListenTo)`
`VerbRule(ListRelations)`
`VerbRule(ListTests)`
`VerbRule(Lock)`
`VerbRule(LockWith)`
`VerbRule(Look)`
`VerbRule(LookBehind)`
`VerbRule(LookHere)`
`VerbRule(LookIn)`
`VerbRule(LookThrough)`
`VerbRule(LookUnder)`
`VerbRule(LookUp)`
`VerbRule(LookX)`
`VerbRule(Move)`
`VerbRule(MoveTo)`
`VerbRule(MoveWith)`
`VerbRule(No)`
`VerbRule(Notify)`
`VerbRule(NotifyOff)`
`VerbRule(NotifyOn)`
`VerbRule(Open)`
`VerbRule(Out)`
`VerbRule(PlugIn)`
`VerbRule(PlugInto)`
`VerbRule(PlugIntoWhat)`
`VerbRule(Pour)`
`VerbRule(PourInto)`
`VerbRule(PourOnto)`
`VerbRule(Pull)`
`VerbRule(Purloin)`
`VerbRule(Push)`
`VerbRule(PushTravelClimbDown)`
`VerbRule(PushTravelClimbUp)`
`VerbRule(PushTravelDir)`
`VerbRule(PushTravelEnter)`
`VerbRule(PushTravelGetOutOf)`
`VerbRule(PushTravelThrough)`
`VerbRule(PutBehind)`
`VerbRule(PutIn)`
`VerbRule(PutOn)`
`VerbRule(PutUnder)`
`VerbRule(PutWhere)`
`VerbRule(Query)`
`VerbRule(Query2)`
`VerbRule(QueryAbout)`
`VerbRule(QueryVague)`
`VerbRule(Quit)`
`VerbRule(Read)`
`VerbRule(Record)`
`VerbRule(RecordEvents)`
`VerbRule(RecordEventsString)`
`VerbRule(RecordOff)`
`VerbRule(RecordString)`
`VerbRule(RelationDetails)`
`VerbRule(Remove)`
`VerbRule(ReplayQuiet)`
`VerbRule(ReplayString)`
`VerbRule(Restart)`
`VerbRule(Restore)`
`VerbRule(RestoreString)`
`VerbRule(Sample)`
`VerbRule(Save)`
`VerbRule(SaveString)`
`VerbRule(Say)`
`VerbRule(SayTo)`
`VerbRule(Score)`
`VerbRule(Screw)`
`VerbRule(ScrewWith)`
`VerbRule(ScriptOff)`
`VerbRule(ScriptOn)`
`VerbRule(ScriptString)`
`VerbRule(Search)`
`VerbRule(Seek)`
`VerbRule(Set)`
`VerbRule(SetTo)`
`VerbRule(ShowTo)`
`VerbRule(ShowToImplicit)`
`VerbRule(ShowToType2)`
`VerbRule(Sit)`
`VerbRule(SitIn)`
`VerbRule(SitOn)`
`VerbRule(Sleep)`
`VerbRule(Smell)`
`VerbRule(SmellSomething)`
`VerbRule(Stand)`
`VerbRule(StandIn)`
`VerbRule(StandOn)`
`VerbRule(Strike)`
`VerbRule(Switch)`
`VerbRule(SwitchOff)`
`VerbRule(SwitchOn)`
`VerbRule(Take)`
`VerbRule(TakeFrom)`
`VerbRule(TalkAbout)`
`VerbRule(TalkAboutImplicit)`
`VerbRule(TalkTo)`
`VerbRule(Taste)`
`VerbRule(TellAbout)`
`VerbRule(TellAboutImplicit)`
`VerbRule(TellAboutWhat)`
`VerbRule(TellThat)`
`VerbRule(TellTo)`
`VerbRule(TellVague)`
`VerbRule(Test)`
`VerbRule(Think)`
`VerbRule(ThinkAbout)`
`VerbRule(Throw)`
`VerbRule(ThrowAt)`
`VerbRule(ThrowDir)`
`VerbRule(ThrowDirDown)`
`VerbRule(ThrowTo)`
`VerbRule(ThrowToType2)`
`VerbRule(ToggleDiaambigEnum)`
`VerbRule(Topics)`
`VerbRule(Travel)`
`VerbRule(Turn)`
`VerbRule(TurnTo)`
`VerbRule(TurnWith)`
`VerbRule(TypeLiteralOn)`
`VerbRule(TypeLiteralOnWhat)`
`VerbRule(TypeOn)`
`VerbRule(Undo)`
`VerbRule(Unfasten)`
`VerbRule(UnfastenFrom)`
`VerbRule(Unlock)`
`VerbRule(UnlockWith)`
`VerbRule(Unplug)`
`VerbRule(UnplugFrom)`
`VerbRule(Unscrew)`
`VerbRule(UnscrewWith)`
`VerbRule(VagueTravel)`
`VerbRule(Verbose)`
`VerbRule(Version)`
`VerbRule(Wait)`
`VerbRule(Wear)`
`VerbRule(WhatAmICarrying)`
`VerbRule(WhatIsNoun)`
`VerbRule(WhatNext)`
`VerbRule(WhatsHere)`
`VerbRule(WhatsThePoint)`
`VerbRule(WhatThisGame)`
`VerbRule(WhereAmI)`
`VerbRule(WhereGo)`
`VerbRule(WhereHelp)`
`VerbRule(WhoAmI)`
`VerbRule(Write)`
`VerbRule(WriteOn)`
`VerbRule(Yell)`
`VerbRule(Yes)`

Global Objects

(none)

Summary of Properties

`isActive priority`

Inherited from `Production` :
`determiner nounPhraseRole npClass parent`

Summary of Methods

`answerMissing build missingRoleProd visitProd`

Inherited from `Production` :
`addNounListItem findAction findChild findParent getNounPhraseRole getText getTokens grammarInfoForBuild isChildOf noteEndOfSentence visitLiteral`

Properties

`isActive` | `parser.t[3977]`

Do we want to consider this production to be active; we may want some VerbRules to be active only under certain circumstanes.

`priority` | `parser.t[3971]`

The "priority" of this grammar rule. This is a contributor to the Command priority - see Command.priority for an explanation of how that's used.

The predicate priority is a small number, 0-99. The default is 50, which should apply to most normal, complete verb phrases. For incomplete phrases (with a missing object, which will force the parser to assume a default or ask the player for the missing information), use 25. Other values are for fine-tuning as needed in the individual grammar rules. A higher value means higher priority.

Methods

`answerMissing (cmd, np)` | `parser.t[4040]`

The parser calls answerMissing() when the player answers a query for a missing noun phrase in the last command. There's nothing that needs to happen here, and by default we do nothing; this is purely advisory. This routine gives the language module a chance to alter the command according to the reply, if necessary.

`build (cmd, np)`OVERRIDDEN | `parser.t[3980]`

build the command

`missingRoleProd (role)` | `grammar.t[3697]`

Get the grammar production for the given noun phrase role, for answering missing-noun questions ("What do you want to open?"). By default, we'll look in three places:

1. If we have the "reply" property that corresponds to the role (dobjReply, iobjReply, etc), we'll return the grammar rule specified there.

2. We'll try to find the role's match property in our grammar rule list. If we find it, we'll return the production for the first one we find.

3. Failing all that, we'll return nounList for a direct object, or singleNoun for anything else.

[Required]

`visitProd (cmd, np, prod)`OVERRIDDEN | `parser.t[4002]`

Visit a production during the build process. If this is one of our noun phrase slots, we tell the command to add a new noun phrase of this type, and make it the current phrase; then we recursively build out this child to populate the new noun phrase.

Adv3Lite Library Reference Manual
Generated on 01/03/2024 from adv3Lite version 1.6.2