QuantifierProductionclass | parser.t[4406]

QuantifierProduction is a subclass of Production for phrases that add a number qualifier, as in "five books".

Each grammar rule of this type needs to define a special '->quant_' association in its template, giving the quantity phrase production. This phrase must in turn provide a 'numval' property giving its numeric value.

Alternatively, this production can itself simply provide a 'numval' property with the correct number. This is convenient for adjective-like qualifier phrases that imply a number without stating one directly, such as BOTH BOOKS.

`class QuantifierProduction : Production`

Superclass Tree (in declaration order)

`QuantifierProduction`
`Production`
`object`

Subclass Tree

`QuantifierProduction`
`disambigPhrase(both)`
`explicitDetPluralNounPhrase(definiteNumber)`
`explicitDetPluralNounPhrase(possessiveNumber)`
`explicitDetPluralNounPhrase(possessiveNumber2)`
`explicitDetPluralOnlyNounPhrase(definiteNumber)`
`explicitDetPluralOnlyNounPhrase(possessiveNumber)`
`explicitDetPluralOnlyNounPhrase(possessiveNumber2)`
`qualifiedPluralNounPhrase(allNum)`
`qualifiedPluralNounPhrase(anyNum)`
`qualifiedPluralNounPhrase(both)`
`qualifiedPluralNounPhrase(definiteNum)`

Global Objects

(none)

Summary of Properties

``

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

Summary of Methods

`build visitProd`

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

Properties

(none)

Methods

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

Build out the subtree. If we have a numval embedded in this production, we'll use it as the quantifier. Otherwise, we'll expect to find a separate quant_ sub-production among our children, and that it provides the quantity.

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

Visit a production. When we visit the quantifier phrase, we'll handle it specially: we'll add the quantifier value to the main noun phrase, and then we *won't* parse into the subtree. There's no need to parse the quantifier subtree, as its entire meaning is captured in its numeric value. Parsing into it is undesirable because that would add the numeric tokens to the noun phrase - they don't belong there, since their qualification is captured in the quantifier and shouldn't also be added as adjectives.

Adv3Lite Library Reference Manual
Generated on 15/03/2023 from adv3Lite version 1.6.1