langMessageBuilderobject | en_us.t[3758] |
Superclass Tree | Property Summary | Method Summary | Property Details | Method Details |
langMessageBuilder : MessageBuilder
langMessageBuilder
MessageBuilder
OutputFilter
object
PreinitObject
ModuleExecObject
object
fixedTenseProp_
lastSubject_
lastSubjectName_
paramList_
pastEnding_
patEndOfSentence
patIdObjApostS
patIdObjSlashIdApostS
patParamWithExclam
patSpecial
patSSlashLetterEd
patTenseSwitching
Inherited from MessageBuilder
:
lastParamObj_
lastTargetObj_
nameTable_
paramTable_
patAllCaps
patIdObj
patIdObjSlashId
patIdSlash
patUpper
Inherited from ModuleExecObject
:
execAfterMe
execBeforeMe
hasInitialized_
isDoingExec_
isExecuted_
generateMessage
getTargetProp
langRewriteParam
processOrig
processResult
Inherited from MessageBuilder
:
execute
filterText
genLiteral
quoteMessage
Inherited from ModuleExecObject
:
_execute
classExec
fixedTenseProp_ | en_us.t[4249] |
lastSubject_ | en_us.t[4053] |
lastSubjectName_ | en_us.t[4056] |
paramList_ OVERRIDDEN | en_us.t[3777] |
Note that we specify two additional elements for each table entry beyond the standard language-independent complement:
info[4] = reflexive property - this is the property to invoke when the parameter is used reflexively (in other words, its target object is the same as the most recent target object used in the nominative case). If this is nil, the parameter has no reflexive form.
info[5] = true if this is a nominative usage, nil if not. We use this to determine which target objects are used in the nominative case, so that we can remember those objects for subsequent reflexive usages.
pastEnding_ | en_us.t[4239] |
patEndOfSentence | en_us.t[4125] |
patIdObjApostS | en_us.t[4159] |
patIdObjSlashIdApostS | en_us.t[4157] |
patParamWithExclam | en_us.t[4161] |
patSpecial | en_us.t[4027] |
We match either a stuttered opening brace, or a single opening brace followed by any sequence of characters that doesn't contain a closing brace followed by a closing brace.
patSSlashLetterEd | en_us.t[4162] |
patTenseSwitching | en_us.t[4040] |
We match a single opening brace, followed by any sequence of characters that doesn't contain a closing brace or a vertical bar, followed by a vertical bar, followed by any sequence of characters that doesn't contain a closing brace or a vertical bar, followed by a closing brace.
generateMessage (orig) OVERRIDDEN | en_us.t[3912] |
getTargetProp (targetObj, paramObj, info) OVERRIDDEN | en_us.t[4069] |
Also, if there was an exclamation mark at the end of any word in the tag, we'll return a property returning a fixed-tense form of the property for the tag.
langRewriteParam (paramStr) OVERRIDDEN | en_us.t[4184] |
For English, we'll handle the possessive apostrophe-s suffix specially, by allowing the apostrophe-s to be appended to the target object name. If we find an apostrophe-s on the target object name, we'll move it to the preceding identifier name:
the dobj's -> the's dobj
the dobj's/he -> the's dobj/he
he/the dobj's -> he/the's dobj
We also use this method to check for the presence of an exclamation mark at the end of any word in the parameter string (triggering the fixed-tense handling), and to detect a parameter string matching the {s/?ed} syntax, where ? is any letter, and rewrite it literally as 's/?ed' literally.
processOrig (str) | en_us.t[3941] |
We use this hook to implement the special tense-switching syntax {<present>|<past>}. Although it superficially looks like an ordinary substitution parameter, we actually can't use the normal parameter substitution framework for that, because we want to allow the <present> and <past> substrings themselves to contain substitution parameters, and the normal framework doesn't allow for recursive substitution.
We simply replace every sequence of the form {<present>|<past>} with either <present> or <past>, depending on the current narrative tense. We then substitute braces for square brackets in the resulting string. This allows treating every bracketed tag inside the tense-switching sequence as a regular substitution parameter.
For example, the sequence "{take[s]|took}" appearing in the message string would be replaced with "take{s}" if the current narrative tense is present, and would be replaced with "took" if the current narrative tense is past. The string "take{s}", if selected, would in turn be expanded to either "take" or "takes", depending on the grammatical person of the subject, as per the regular substitution mechanism.
processResult (txt) OVERRIDDEN | en_us.t[4130] |