NounRole class | parser.t[3790]

A NounRole is a internal parser object that provides information on a given noun role in a predicate.

A noun role is one of the standard semantic roles that a noun phrase can play in a natural language predicate. A predicate is a combination of an action and the objects that it applies to. Any given verb has a set of assigned roles that need to be filled to make a complete thought. (Sometimes the same verb word has multiple senses with different numbers of slots to fill, but you can think of the different senses as actually being different actions at some abstract level, which all happen to share the same verb word.) For example, TAKE requires a noun phrase telling us which object is to be taken; this is called the direct object of the verb. PUT X IN Y has a direct object (the thing to be put somewhere) and an indirect object (the place to put it).

Natural languages use a fairly small number of these noun roles. Most predicates in most languages have just one role: TAKE, DROP, OPEN, CLOSE. We call this first-and-only noun role the direct object. A few predicates have two roles: PUT IN, GIVE TO, UNLOCK WITH. We call the second role the indirect object. A very few predicates have three roles: TRADE BOB AN APPLE FOR AN ORANGE, PUT PLUTONIUM IN REACTOR WITH TONGS. We call the third role the "accessory" object (which is something we made up - there doesn't seem to be an agreed-upon word among linguists for this role). And it appears that there's simply no such thing as a "tetratransitive" verb in any natural human language, so we don't bother defining a fourth slot.

(It would be easy for a game to add an object defining a fourth slot, analogous with these others, and use it to include a fourth noun phrase in the grammar for applicable verbs. The rest of the parser will pick it up automatically if you do. However, the practical utility of this seems minimal. *Three*-noun verbs are incredibly rare in IF, in part because situations requiring them are rare, and in part because they're almost guaranteed to vex players and be panned as guess-the-syntax puzzles. One can only imagine how a *four*-noun command would be received.)

`class NounRole : object`

Superclass Tree (in declaration order)

`NounRole`
`object`

Subclass Tree

(none)

Global Objects

`AccessoryObject ActorRole DirectObject IndirectObject`

Summary of Properties

`all allPredicate isPredicate matchProp missingReplyProp name npListProp objListProp objMatchProp objProp order`

Summary of Methods

`construct`

Properties

`all` | `parser.t[3838]`

class property: master list of all roles

`allPredicate` | `parser.t[3841]`

class property: master list of all predicate roles

`isPredicate` | `parser.t[3816]`

Is this a predicate noun phrase role? This is true for roles that serve as objects of a verb: direct object, indirect object, accessory. This is nil for non-predicate roles, such as the addressee actor.

`matchProp` | `parser.t[3796]`

The -> property slot in the predicate grammar that's assigned to this role. This is the property that predicate grammar rules assign for the match tree for a noun phrase taking this role.

`missingReplyProp` | `parser.t[3822]`

the predicate match object property that gives the grammar rule for parsing a reply to a missing noun question for this role

`name` | `parser.t[3828]`

name - this is an ID string that we use internally for embedding the role in things like verb template strings

`npListProp` | `parser.t[3799]`

the NounPhrase list property in the Command object for this role

`objListProp` | `parser.t[3802]`

the object match list property in the Command object for this role

`objMatchProp` | `parser.t[3808]`

the property in the Command for the current item's NPMatch

`objProp` | `parser.t[3805]`

the property in the Command for the *current* item being executed

`order` | `parser.t[3835]`

Internal sequence number. This tells us the order in which this role appears in lists (including argument lists) when we store lists of roles.

Methods

`construct ( )` | `parser.t[3844]`

on construction, populate the various maps

Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0