VerbProductionclass | parser.t[4020], grammar.t[3741] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
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[3741]:
English-specific VerbProduction additions
class
VerbProduction : Production
VerbProduction
Production
object
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(EnumerateSuggestions)
VerbRule(Evaluate)
VerbRule(Examine)
VerbRule(Exits)
VerbRule(ExitsColour)
VerbRule(ExitsMode)
VerbRule(Extinguish)
VerbRule(ExtraHints)
VerbRule(FactInfo)
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(HyperlinkSuggestions)
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(ListFacts)
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(MoveAwayFrom)
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(SpecialAction)
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(TypeVague)
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(WriteVague)
VerbRule(Yell)
VerbRule(Yes)
Inherited from Production
:
determiner
nounPhraseRole
npClass
parent
answerMissing
build
missingRoleProd
visitProd
Inherited from Production
:
addNounListItem
findAction
findChild
findParent
getNounPhraseRole
getText
getTokens
grammarInfoForBuild
isChildOf
noteEndOfSentence
visitLiteral
isActive | parser.t[4040] |
priority | parser.t[4034] |
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.
answerMissing (cmd, np) | parser.t[4103] |
build (cmd, np) OVERRIDDEN | parser.t[4043] |
missingRoleProd (role) | grammar.t[3760] |
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[4065] |