english.tfilesource file

The main English language module.

This is the English implementation of the generic language interfaces. All of the code here is English-specific, so other language modules will replace the actual implementation. However, somef of the methods and properties are part of the generic interface - this means that each language module must define methods and properties with these names, and with the abstract behavior described. How they actually implement the behavior is up to them.

Methods and properties that are part of the generic interface are identified with [Required].

Summary of Classes  

CustomVocab  LCommandTopicHelper  LMentionable  LState 

Summary of Global Objects  

actorActionContinuer_  decimalPreParser  DirState  disambigPreParser  englishCustomVocab  englishMessageParams  englishOptions  enumTabObj  finishOptionsLister  getOnGroundDoer  libMessages  LitUnlit  OpenClosed  prevDummy_  pronounPreinit  putOnGroundDoer  removeDoer  subLister  takePathDoer 

Summary of Global Functions  

andList  announceBestChoice  askAmbiguous  askMissingNoun  conjugate  conjugateBe  conjugateBeNot  conjugateCan  conjugateDoNot  conjugateDont  conjugateHavenot  conjugateHavnt  conjugateIm  conjugateIsnt  conjugateIve  conjugateMust  conjugateRegular  conjugateWas  conjugateWasnot  conjugateWasnt  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefMood  DefStance  DefStance  DefStance  DefStance  DefStance  DefStance  DefStance  DefStance  DefStance  DefStance  DefStance  genList  isListStr  langAdjust  listStrIs  makeCountedPlural  makeListInStr  makeListStr  makeSentence  mentionA  mentionThe  mergeDuplicates  nounRoleQuestion  npListPronoun  orList  pastParticiple  spelledToInt  spellNumber  stripArticle  yesOrNo 

Global Functions  

andList (lst)english.t[3525]

Construct a printable list of strings separated by "and" conjunctions.

announceBestChoice (action, obj, role)english.t[3915]
Announce our choice of object when askForIobj() or askForDobj() chooses the best match on the player's behalf. We find the section of the verbPhrase appropriate to the direct or indirect object (e.g. '(what)' or '(on what)') and replace 'what' with the object name.

askAmbiguous (cmd, role, names)english.t[3800]
Ask for help with an ambiguous noun. The parser calls this when the player enters a noun phrase that's ambiguous, and we need to ask for clarification.

'cmd' is the command, 'role' is the noun phrase's role in the predicate (DirectObject, etc), and 'nameList' is a list of strings determined by the Distinguisher process.

[Required]

askMissingNoun (cmd, role)english.t[3784]
Ask for a missing noun phrase. The parser calls this when the player enters a command that omits a required noun phrase, such as PUT KEY or just TAKE.

'cmd' is the Command object. The other objects in the command, if any, have been resolved as much as possible when this is called. 'role' is the NounRole object telling us which predicate role is missing (DirectObject, IndirectObject, etc).

[Required]

conjugate (ctx, params)english.t[4715]
Regular verb conjugator. This takes the list of CustomVocab verbParmas tokens built during preinit, and returns the appropriate conjugation for the subject and tense.

conjugateBe (ctx, params)english.t[4908]
Conjugate "to be". This is a handler function for message parameter expansion, for the "be" verb parameters ({am}, {is}, {are}).

conjugateBeNot (ctx, params)english.t[4953]
Conjugate "to be" in negative senses. This is a handler function for message parameter expansion, for auxiliaries with negative usage (cannot, will not, etc).

conjugateCan (ctx, params, beFunc, present, past)english.t[5327]
Conjugate 'can', 'can\'t', or 'cannot'. In the present, these are variations on "I can"; in the past, "I could"; in all other tenses, these change to conjugations of "to be able to": I have been able to, I had been able to, I will be able to, I will have been able to.

conjugateDoNot (ctx, params)english.t[5279]
Conjugate "do not" plus a verb. "Do not" is always an auxiliary in English, and has an irregular structure in different tenses. The second token in the {donot x} phrase is the main verb we're auxiliarizing.

conjugateDont (ctx, params)english.t[5232]
Conjugate "don't" plus a verb. "Don't" is always an auxiliary in English, and has an irregular structure in different tenses. The second token in the {don't x} phrase is the main verb we're auxiliarizing.

conjugateHavenot (ctx, params)english.t[5205]
no description available

conjugateHavnt (ctx, params)english.t[5183]
Conjugate haven\'t (contracted have not)

conjugateIm (ctx, params)english.t[5043]
Conjugate "to be" contractions - I'm, you're, he's, she's, etc. This is a handler function for message parameter expansion, for the "be" verb parameters with contraction ({I'm}, {he's}, {you're}).

conjugateIsnt (ctx, params)english.t[4998]
Conjugate "isn't". This is a handler function for message parameter expansion, for the "be" verb parameters with "not" contractions ({am not}, {isn't}, {aren't}).

conjugateIve (ctx, params)english.t[5155]
Conjugate 've (contraction of have). After some words it's better not to contract (e.g. Liz's or Jesus'd is a a bit awkward) so we use the full 'have' or 'had' form for such subjects and the contracted form otherwise.

conjugateMust (ctx, params)english.t[5353]
Conjugate "must" plus a verb. In the present, this is "I must <x>"; in other tenses, this is a conjugation of "to have to <x>": I had to <x>, I have to have <xed>, I had to have <xed>, I will have to <x>, I will have to have <xed>.

conjugateRegular (ctx, params)english.t[4798]
Conjugate a regular verb

conjugateWas (ctx, params)english.t[5089]
Conjugate the past tense of "to be" where we want to use the past tense in a present context (e.g. "You can see that Kilroy was here. "). This is a handler function for {was} or {were}.

conjugateWasnot (ctx, params)english.t[5129]
no description available

conjugateWasnt (ctx, params)english.t[5109]
no description available

DefMood (neutral)english.t[6170]
Definitions for moods. We define them in the language-specific part of the library so that translators can use more appropriate names for their languages. Game code can readily define more moods if needs them.

DefMood (calm)english.t[6171]
no description available

DefMood (happy)english.t[6172]
no description available

DefMood (euphoric)english.t[6173]
no description available

DefMood (contented)english.t[6174]
no description available

DefMood (sad)english.t[6175]
no description available

DefMood (depressed)english.t[6176]
no description available

DefMood (angry)english.t[6177]
no description available

DefMood (furious)english.t[6178]
no description available

DefMood (afraid)english.t[6179]
no description available

DefMood (terrified)english.t[6180]
no description available

DefMood (confident)english.t[6181]
no description available

DefMood (bold)english.t[6182]
no description available

DefMood (lonely)english.t[6183]
no description available

DefMood (bored)english.t[6184]
no description available

DefMood (excited)english.t[6185]
no description available

DefStance (amorous, 50)english.t[6153]
Definitions for moods. We define them in the language-specific part of the library so that translators can use more appropriate names for their languages.

DefStance (loving, 40)english.t[6154]
no description available

DefStance (warm, 30)english.t[6155]
no description available

DefStance (friendly, 20)english.t[6156]
no description available

DefStance (cordial, 10)english.t[6157]
no description available

DefStance (neutral, 0)english.t[6158]
no description available

DefStance (cool, -, 10)english.t[6159]
no description available

DefStance (unfriendly, -, 20)english.t[6160]
no description available

DefStance (hostile, -, 30)english.t[6161]
no description available

DefStance (venemous, -, 40)english.t[6162]
no description available

DefStance (hateful, -, 50)english.t[6163]
no description available

genList (lst, conj)english.t[3533]
General list constructor

isListStr (objList)english.t[3493]
Function for use with the <<is list of *>> string template, prefixing a list with the correct form of the verb to be to match the grammatical number of the list (e.g. "There are a box and a glove here" or "There is box here").

langAdjust (txt)english.t[4764]
Language specific adjustments to a string applied before the message processor looks for parameter substitutions. Here we scan txt for sequences like 'verb{s/d}' and convert them to '{conj verb s/d}', which the parameter substitution mechanism can then deal with.

listStrIs (objList)english.t[3508]
Function for use by the <<list of * is>> string template, which returns a formatted list followed by the appropriate form of the verb 'to be' in grammatical agreement with that list.

makeCountedPlural (str, num)english.t[3639]
Take the string representation of a name (str) and a number (num) and return a string with the number spelled out and the name pluralised, e.g. makeCountPlural('a cat', 3) -> 'three cats' Amended to deal with the more complex case ('taking the coin'), 3) -> 'taking three coins'); i.e. the method now substitutes the number for the first occurrence of an article, if there is one.

makeListInStr (objList)english.t[3482]
A version of makeListStr that uses only one parameter, for use by the <<list of *>>string template

makeListStr (objList, nameProp, =, &, aName, conjunction, =, ', and, ')english.t[3376]
Take a list of objects supplied in objList and return a formatted list in a single quoted string, having first sorted the items in objList in the order of their listOrder property.

If the nameProp parameter is supplied, we'll use that property for the name of every item in the list; otherwise we use the aName property by default.

By default the last two items in the list are separated by 'and', but we can choose a different conjunction by supplying the conjunction parameter.

makeSentence (msg)english.t[4150]
make an error message into a sentence, by capitalizing the first letter and adding a period at the end if it doesn't already have one

mentionA (obj)english.t[3435]
Function to use with the <<mention a *>> string template. This marks the object as mentioned in a room description and allows it to be used as the antecedent of a {prev} tag, to ensure verb agreement.

mentionThe (obj)english.t[3459]
Function to use with the <<mention the *>> string template. This marks the object as mentioned in a room description and allows it to be used as the antecedent of a {prev} tag, to ensure verb agreement.

mergeDuplicates (lst)english.t[3571]
Take a list of strings of the form ['a book', 'a cat', 'a book'] and merge the duplicate items to return a list of the form ['two books', 'a cat']

nounRoleQuestion (cmd, role)english.t[3861]
Get the basic question for a noun role. This turns the verb around into a question about one of its roles. For example, for (Open, DirectObject), we'd return "what do you want to open". For (AttachTo IndirectObject), "what do you want to connect it to".

npListPronoun (pro, nplst, prep)english.t[3951]
Get the pronoun for a resolved (or partially resolved) NounPhrase list from a command.

orList (lst)english.t[3517]
Construct a printable list of strings separated by "or" conjunctions.

pastParticiple (verb)english.t[4872]
Form the past participle of a verb, which may either be given in the form xxx, in which case we assume it's an irregular verb to be looked up in the table of irregular verbs, or in the form xxx[y/z], in which case we assume it's a regular verb to be conjugated according to the [y/z] ending.

spelledToInt (str)english.t[2909]
Try to convert a spelled out number (e.g. 'ninety-six') to its integer representation. If this fails, return nil.

spellNumber (n)english.t[2813]
Generate a spelled-out version of the given number value, or simply a string representation of the number. We follow fairly standard English style rules:


- we spell out numbers below 100
- we also spell out round figures above 100 that can be expressed
in two words (e.g., "fifteen thousand" or "thirty million")
- for millions and billions, we write, e.g., "1.7 million", if possible
- for anything else, we return the decimal digits, with commas to
separate groups of thousands (e.g., 120,400)

Other languages might have different style rules, so the choice using a spelled-out number or digits might vary by language.

[Required]

stripArticle (txt)english.t[3680]
Remove any definite or indefinite article that occurs at the beginning of txt, and return the resultant string in lower case.

yesOrNo ( )english.t[5895]
Simple yes/no confirmation. The caller must display a prompt; we'll read a command line response, then return true if it's an affirmative response, nil if not.

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