en_us.t file | source file

Past-tense extensions written by Michel Nizette, and incorporated by permission.

TADS 3 Library - English (United States variant) implementation

This defines the parts of the TADS 3 library that are specific to the English language as spoken (and written) in the United States.

We have attempted to isolate here the parts of the library that are language-specific, so that translations to other languages or dialects can be created by replacing this module, without changing the rest of the library.

In addition to this module, a separate set of US English messages are defined in the various msg_xxx.t modules. Those modules define messages in English for different stylistic variations. For a given game, the author must select one of the message modules - but only one, since they all define variations of the same messages. To translate the library, a translator must create at least one module defining those messages as well; only one message module is required per language.

The past-tense system was contributed by Michel Nizette.

-----

"Watch an immigrant struggling with a second language or a stroke patient with a first one, or deconstruct a snatch of baby talk, or try to program a computer to understand English, and ordinary speech begins to look different."

Stephen Pinker, "The Language Instinct"

Summary of Classes

`aboutTopicPhrase(main) actorBadCommandPhrase(main) adjPhrase(adj) adjPhrase(adjAdj) AdjPhraseWithVocab adjWord(adj) adjWord(adjAbbr) adjWord(adjApostS) atSingleNoun(main) ChildNameAsOther commandOnlyConjunction(nonSentenceEnding) commandOnlyConjunction(sentenceEnding) commandOrNounConjunction(main) completeNounPhrase(main) completeNounPhrase(miscPrep) completeNounPhraseWithAll(main) completeNounPhraseWithoutAll(her) completeNounPhraseWithoutAll(herself) completeNounPhraseWithoutAll(him) completeNounPhraseWithoutAll(himself) completeNounPhraseWithoutAll(it) completeNounPhraseWithoutAll(itself) completeNounPhraseWithoutAll(me) completeNounPhraseWithoutAll(qualified) completeNounPhraseWithoutAll(them) completeNounPhraseWithoutAll(themselves) completeNounPhraseWithoutAll(yourself) compoundNounPhrase(of) compoundNounPhrase(simple) compoundPluralPhrase(of) compoundPluralPhrase(simple) detPluralNounPhrase(main) detPluralOnlyNounPhrase(main) directionName(aft) directionName(down) directionName(east) directionName(fore) directionName(in) directionName(north) directionName(northeast) directionName(northwest) directionName(out) directionName(port) directionName(south) directionName(southeast) directionName(southwest) directionName(starboard) directionName(up) directionName(west) disambigList(list) disambigList(single) disambigListItem(noun) disambigListItem(ordinal) disambigListItem(plural) disambigListItem(possessive) disambigOrdinalList(head) disambigOrdinalList(tail) DisambigOrdProd disambigPhrase(all) disambigPhrase(any) disambigPhrase(both) disambigPhrase(list) disambigPhrase(ordinalList) DisambigVocabProd EnTravelVia exceptList(list) exceptList(single) exceptNounPhrase(singleComplete) exceptNounPhrase(singlePossessive) explicitDetPluralNounPhrase(definite) explicitDetPluralNounPhrase(definiteNumber) explicitDetPluralNounPhrase(possessive) explicitDetPluralNounPhrase(possessiveNumber) explicitDetPluralOnlyNounPhrase(definite) explicitDetPluralOnlyNounPhrase(definiteNumber) explicitDetPluralOnlyNounPhrase(possessive) explicitDetPluralOnlyNounPhrase(possessiveNumber) firstCommandPhrase(askTellActorTo) firstCommandPhrase(withActor) forSingleNoun(main) fromSingleNoun(main) GetVerbPhraseContext ImplicitAnnouncementContext implicitDetPluralOnlyNounPhrase(main) indetPluralNounPhrase(basic) indetPluralNounPhrase(locational) indetPluralOnlyNounPhrase(basic) indetPluralOnlyNounPhrase(locational) indetSingularNounPhrase(basic) indetSingularNounPhrase(locational) inSingleNoun(main) ListImpCtx literalAdjPhrase(literalAdj) literalAdjPhrase(number) literalAdjPhrase(string) literalPhrase(empty) literalPhrase(miscList) literalPhrase(string) mainDisambigPhrase(main) MessageHelper miscWordList(list) miscWordList(wordOrNumber) NameAsOther NameAsParent nonTerminalNounMultiList(multi) nonTerminalNounMultiList(pair) nounConjunction(main) nounList(empty) nounList(list) nounList(nonTerminal) nounList(terminal) nounMultiList(multi) nounMultiList(nonterminal) nounPhrase(main) nounWord(noun) nounWord(nounAbbr) NounWordProd numberPhrase(digits) numberPhrase(spelled) NumberProd onSingleNoun(main) oopsCommand(main) oopsPhrase(main) oopsPhrase(missing) outOfSingleNoun(main) pluralPhrase(main) possessiveAdjPhrase(her) possessiveAdjPhrase(his) possessiveAdjPhrase(its) possessiveAdjPhrase(my) possessiveAdjPhrase(npApostropheS) possessiveAdjPhrase(ppApostropheS) possessiveAdjPhrase(their) possessiveAdjPhrase(your) possessiveNounPhrase(hers) possessiveNounPhrase(his) possessiveNounPhrase(its) possessiveNounPhrase(mine) possessiveNounPhrase(npApostropheS) possessiveNounPhrase(theirs) possessiveNounPhrase(yours) poundNumberPhrase(main) predicate(About) predicate(Again) predicate(AskAbout) predicate(AskAboutImplicit) predicate(AskAboutWhat) predicate(AskFor) predicate(AskVague) predicate(AskWhomFor) predicate(AttachTo) predicate(AttachToWhat) predicate(Attack) predicate(AttackWith) predicate(Board) predicate(Break) predicate(Burn) predicate(BurnWith) predicate(Clean) predicate(CleanWith) predicate(Climb) predicate(ClimbDown) predicate(ClimbDownWhat) predicate(ClimbUp) predicate(ClimbUpWhat) predicate(Close) predicate(Consult) predicate(ConsultAbout) predicate(ConsultWhatAbout) predicate(Credits) predicate(CutWith) predicate(CutWithWhat) predicate(Detach) predicate(DetachFrom) predicate(Dig) predicate(DigWith) predicate(Doff) predicate(Drink) predicate(Drop) predicate(Eat) predicate(Enter) predicate(EnterOn) predicate(EnterOnWhat) predicate(Examine) predicate(Exits) predicate(ExitsMode) predicate(Extinguish) predicate(Fasten) predicate(FastenTo) predicate(Feel) predicate(Flip) predicate(Follow) predicate(Footnote) predicate(FootnotesFull) predicate(FootnotesMedium) predicate(FootnotesOff) predicate(FootnotesStatus) predicate(FullScore) predicate(GetOffOf) predicate(GetOut) predicate(GetOutOf) predicate(GiveTo) predicate(GiveToType2) predicate(GiveToWhom) predicate(GoBack) predicate(Goodbye) predicate(GoThrough) predicate(Hello) predicate(Hint) predicate(HintsOff) predicate(In) predicate(Inventory) predicate(InventoryTall) predicate(InventoryWide) predicate(Jump) predicate(JumpOff) predicate(JumpOffI) predicate(JumpOver) predicate(Kiss) predicate(Lie) predicate(LieOn) predicate(Light) predicate(ListenImplicit) predicate(ListenTo) predicate(Lock) predicate(LockWith) predicate(Look) predicate(LookBehind) predicate(LookIn) predicate(LookThrough) predicate(LookUnder) predicate(Move) predicate(MoveTo) predicate(MoveWith) predicate(No) predicate(Notify) predicate(NotifyOff) predicate(NotifyOn) predicate(Oops) predicate(OopsOnly) predicate(Open) predicate(Out) predicate(Pause) predicate(PlugIn) predicate(PlugInto) predicate(PlugIntoWhat) predicate(Port) predicate(Pour) predicate(PourInto) predicate(PourOnto) predicate(Pull) predicate(Push) predicate(PushTravelClimbDown) predicate(PushTravelClimbUp) predicate(PushTravelDir) predicate(PushTravelEnter) predicate(PushTravelGetOutOf) predicate(PushTravelThrough) predicate(PutBehind) predicate(PutIn) predicate(PutInWhat) predicate(PutOn) predicate(PutUnder) predicate(Quit) predicate(Read) predicate(Record) predicate(RecordEvents) predicate(RecordEventsString) predicate(RecordOff) predicate(RecordString) predicate(Remove) predicate(ReplayQuiet) predicate(ReplayString) predicate(Restart) predicate(Restore) predicate(RestoreDefaults) predicate(RestoreString) predicate(Save) predicate(SaveDefaults) predicate(SaveString) predicate(Score) predicate(Screw) predicate(ScrewWith) predicate(Script) predicate(ScriptOff) predicate(ScriptString) predicate(Search) predicate(Set) predicate(SetTo) predicate(ShowTo) predicate(ShowToType2) predicate(ShowToWhom) predicate(Sit) predicate(SitOn) predicate(Sleep) predicate(Smell) predicate(SmellImplicit) predicate(Stand) predicate(StandOn) predicate(Starboard) predicate(Strike) predicate(Switch) predicate(Take) predicate(TakeFrom) predicate(TalkTo) predicate(TalkToWhat) predicate(Taste) predicate(TellAbout) predicate(TellAboutImplicit) predicate(TellAboutWhat) predicate(TellVague) predicate(Terse) predicate(Throw) predicate(ThrowAt) predicate(ThrowDir) predicate(ThrowDirDown) predicate(ThrowTo) predicate(ThrowToType2) predicate(TipsOff) predicate(TipsOn) predicate(Topics) predicate(Travel) predicate(Turn) predicate(TurnOff) predicate(TurnOn) predicate(TurnTo) predicate(TurnWith) predicate(TypeLiteralOn) predicate(TypeLiteralOnWhat) predicate(TypeOn) predicate(Undo) predicate(Unfasten) predicate(UnfastenFrom) predicate(Unlock) predicate(UnlockWith) predicate(Unplug) predicate(UnplugFrom) predicate(Unscrew) predicate(UnscrewWith) predicate(VagueTravel) predicate(Verbose) predicate(Version) predicate(Wait) predicate(Wear) predicate(Yell) predicate(Yes) PrepSingleNounProd PrepSingleTopicProd qualifiedNounPhrase(main) qualifiedPluralNounPhrase(all) qualifiedPluralNounPhrase(allNum) qualifiedPluralNounPhrase(anyNum) qualifiedPluralNounPhrase(both) qualifiedPluralNounPhrase(determiner) qualifiedPluralNounPhrase(theOnesIn) qualifiedSingularNounPhrase(anyOneIn) qualifiedSingularNounPhrase(anyPlural) qualifiedSingularNounPhrase(arbitrary) qualifiedSingularNounPhrase(definite) qualifiedSingularNounPhrase(indefinite) qualifiedSingularNounPhrase(possessive) qualifiedSingularNounPhrase(theOneIn) quotedStringPhrase(main) simpleNounPhrase(adj) simpleNounPhrase(adjAndOne) simpleNounPhrase(adjNP) simpleNounPhrase(empty) simpleNounPhrase(misc) simpleNounPhrase(noun) simpleNounPhrase(nounAndNumber) simpleNounPhrase(number) simpleNounPhrase(numberAndNoun) simplePluralPhrase(adj) simplePluralPhrase(adjAndOnes) simplePluralPhrase(empty) simplePluralPhrase(misc) simplePluralPhrase(plural) simplePluralPhrase(poundNum) singleNoun(empty) singleNoun(multiple) singleNoun(normal) singleNounOnly(main) spelledHundred(aHundred) spelledHundred(aHundredPlus) spelledHundred(hundreds) spelledHundred(hundredsPlus) spelledHundred(small) spelledMillion(aMillion) spelledMillion(aMillionAndSmall) spelledMillion(millions) spelledMillion(millionsAndSmall) spelledMillion(millionsPlus) spelledNumber(main) spelledSmallNumber(digit) spelledSmallNumber(teen) spelledSmallNumber(tens) spelledSmallNumber(tensAndUnits) spelledSmallNumber(zero) spelledThousand(aThousand) spelledThousand(aThousandAndSmall) spelledThousand(thousands) spelledThousand(thousandsAndSmall) spelledThousand(thousandsPlus) StrikeAction terminalNounPhrase(allBut) terminalNounPhrase(anyBut) terminalNounPhrase(pluralExcept) throughSingleNoun(main) topicPhrase(main) topicPhrase(misc) toSingleNoun(main) withSingleNoun(main)`

Summary of Global Objects

`askingImpCtx cmdTokenizer defaultGetVerbPhraseContext enterOnWhatAsker langMessageBuilder languageGlobals lightSourceStateOff lightSourceStateOn matchStateLit matchStateUnlit standardImpCtx tryingImpCtx typographicalOutputFilter unwornState wornState`

Summary of Global Functions

`intOrdinal intToDecimal parseInt parseIntTokens spellInt spellIntBelow spellIntBelowExt spellIntExt spellIntOrdinal spellIntOrdinalExt stripQuotesFrom withTense yesOrNo`

Global Functions

`intOrdinal (n)` | `en_us.t[4580]`

Return a string giving the numeric ordinal representation of a number: 1st, 2nd, 3rd, 4th, etc.

`intToDecimal (val, flags)` | `en_us.t[4361]`

Format a number as a string of decimal digits. The DigitFormatXxx flags specify how the number is to be formatted.`

`parseInt (str)` | `en_us.t[4683]`

Parse a spelled-out number. This is essentially the reverse of spellInt() and related functions: we take a string that contains a spelled-out number and return the integer value. This uses the command parser's spelled-out number rules, so we can parse anything that would be recognized as a number in a command.

If the string contains numerals, we'll treat it as a number in digit format: for example, if it contains '789', we'll return 789.

If the string doesn't parse as a number, we return nil.

`parseIntTokens (toks)` | `en_us.t[4709]`

Parse a spelled-out number that's given as a token list (as returned from Tokenizer.tokenize). If we can successfully parse the token list as a number, we'll return the integer value. If not, we'll return nil.

`spellInt (val)` | `en_us.t[4310]`

Spell out an integer number in words. Returns a string with the spelled-out number.

Note that this simple version of the function uses the default options. If you want to specify non-default options with the SpellIntXxx flags, you can call spellIntExt().

`spellIntBelow (val, threshold)` | `en_us.t[4326]`

Spell out an integer number in words, but only if it's below the given threshold. It's often awkward in prose to spell out large numbers, but exactly what constitutes a large number depends on context, so this routine lets the caller specify the threshold.

If the absolute value of val is less than (not equal to) the threshold value, we'll return a string with the number spelled out. If the absolute value is greater than or equal to the threshold value, we'll return a string representing the number in decimal digits.

`spellIntBelowExt (val, threshold, spellFlags, digitFlags)` | `en_us.t[4337]`

Spell out an integer number in words if it's below a threshold, using the spellIntXxx flags given in spellFlags to control the spelled-out format, and using the DigitFormatXxx flags in digitFlags to control the digit format.

`spellIntExt (val, flags)` | `en_us.t[4425]`

Spell out an integer number - "extended" interface with flags. The "flags" argument is a (bitwise-OR'd) combination of SpellIntXxx values, specifying the desired format of the result.

`spellIntOrdinal (n)` | `en_us.t[4625]`

Return a string giving a fully spelled-out ordinal form of a number: first, second, third, etc.

`spellIntOrdinalExt (n, flags)` | `en_us.t[4635]`

Return a string giving a fully spelled-out ordinal form of a number: first, second, third, etc. This form takes the same flag values as spellIntExt().

`stripQuotesFrom (str)` | `en_us.t[7106]`

Service routine: strip quotes from a *possibly* quoted string. If the string starts with a quote, we'll remove the open quote. If it starts with a quote and it ends with a corresponding close quote, we'll remove that as well.

`withTense (usePastTense, callback)` | `en_us.t[4258]`

Temporarily override the current narrative tense and invoke a callback function.

`yesOrNo ( )` | `en_us.t[63]`

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.

TADS 3 Library Manual
Generated on 8/21/2012 from TADS version 3.1.2