Pronounclass | parser.t[4623], english.t[2226] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
The base library defines a set of pronouns that are common to most languages: It, Him, Her, Them, You, Y'all, Me, and Us, plus reflexive forms of It, Him, Her, and Them. Some languages might not employ all of these (French, for example, has no neuter gender, so there's no equivalent of It), and some might need additional pronouns (e.g., French needs a feminine third-person plural). If a pronoun we define here has no equivalent in a given language, the language module should simply omit any grammar mentioning it. If the language has pronouns that aren't in the basic set, the language module can provide definitions for its own additional Pronoun objects, along with the corresponding grammar rules.
The library itself only directly references one pronoun object: You. The parser specifically references this pronoun because it binds to the addressee of a command, which has a special role in the parsing process. Apart from You, though, the library's use of pronouns is directed by the grammar: if a given Pronoun doesn't appear in the grammar anywhere, the library will never use it. (Other than in iterations over Pronoun instances, anyway; but these will be harmless because the parser is just trying to be inclusive.) This means that language modules are free to ignore pronouns (other than You) from the standard set when they're not a good match for the language's needs. For example, if you need distinct Animate and Inanimate forms of Him and Her, you could simply define four new Pronoun objects for these forms, and use them in place of Him and Her throughout your grammar.
Note that these objects are NOT grammar rules or dictionary words. These are abstract objects representing the "binding" of the pronouns - basically the set of grammatical attributes (gender, number) that determine whether a given noun phrase is a valid antecedent for a given pronoun. That's why we don't define separate Pronoun objects the different grammatical cases (nominative, accusative, dative, etc): case is a feature of the grammar, and we're one step removed from that here.
Modified in english.t[2226]:
Modifications to Pronoun to ensure that aName, theName and theObjName return the appropriate results.
class
Pronoun : object
Pronoun
ReflexivePronoun
Her
Him
It
Me
Them
Us
Yall
You
all
aName
ante
person
reflexive
theName
theObjName
construct
matchObj
resolve
setAntecedents
all | parser.t[4687] |
aName | english.t[2227] |
ante | parser.t[4674] |
person | parser.t[4644] |
reflexive | parser.t[4680] |
theName | english.t[2228] |
theObjName | english.t[2229] |
construct ( ) | parser.t[4690] |
matchObj (obj) | parser.t[4668] |
resolve ( ) | parser.t[4637] |
For a reflexive pronoun, return the Pronoun object for the ordinary form of the pronoun. This tells the parser that it needs to find a match for the pronoun within the command itself, rather than looking for an external antecedent. Second person is inherently reflexive, in that it refers to the addressee(s), so this should return 'self' for a second-person pronoun.
setAntecedents (obj) | parser.t[4661] |