{\rtf1\ansi \deff4\deflang1033{\fonttbl{\f0\froman\fcharset0\fprq2 Tms Rmn;}{\f1\froman\fcharset2\fprq2 Symbol;}{\f2\fswiss\fcharset0\fprq2 Helv;}{\f3\fmodern\fcharset0\fprq1 Courier;}
{\f4\froman\fcharset0\fprq2 Times New Roman;}{\f5\fswiss\fcharset0\fprq2 Arial;}{\f6\froman\fcharset0\fprq2 MS Serif;}{\f7\fswiss\fcharset0\fprq2 MS Sans Serif;}{\f8\froman\fcharset0\fprq2 Times;}{\f9\fswiss\fcharset0\fprq2 Helvetica;}
{\f10\fswiss\fcharset0\fprq2 System;}{\f11\fmodern\fcharset0\fprq1 Courier New;}{\f12\fmodern\fcharset0\fprq1 Fixedsys;}{\f13\fmodern\fcharset255\fprq1 Terminal;}{\f14\fswiss\fcharset0\fprq2 Small Fonts;}{\f15\fmodern\fcharset255\fprq2 Modern;}
{\f16\fscript\fcharset255\fprq2 Script;}{\f17\froman\fcharset255\fprq2 Roman;}{\f18\froman\fcharset0\fprq2 HM Phonetic;}{\f19\fswiss\fcharset0\fprq2 MS Dialog;}{\f20\fswiss\fcharset0\fprq2 MS Dialog Light;}{\f21\fswiss\fcharset0\fprq2 MS SystemEx;}
{\f22\fnil\fcharset2\fprq2 Marlett;}{\f23\fnil\fcharset2\fprq2 Wingdings;}{\f24\fdecor\fcharset0\fprq2 Algerian;}{\f25\fswiss\fcharset0\fprq2 Arial Rounded MT Bold;}{\f26\fdecor\fcharset0\fprq2 Bauhaus 93;}{\f27\froman\fcharset0\fprq2 Bookman Old Style;}
{\f28\fdecor\fcharset0\fprq2 Braggadocio;}{\f29\fswiss\fcharset0\fprq2 Britannic Bold;}{\f30\fscript\fcharset0\fprq2 Brush Script MT;}{\f31\fswiss\fcharset0\fprq2 Century Gothic;}{\f32\fdecor\fcharset0\fprq2 Colonna MT;}
{\f33\fdecor\fcharset0\fprq2 Desdemona;}{\f34\froman\fcharset0\fprq2 Footlight MT Light;}{\f35\fscript\fcharset0\fprq2 Gradl;}{\f36\fswiss\fcharset0\fprq2 Impact;}{\f37\fdecor\fcharset0\fprq2 Kino MT;}{\f38\froman\fcharset0\fprq2 Wide Latin;}
{\f39\fscript\fcharset0\fprq2 Matura MT Script Capitals;}{\f40\fscript\fcharset0\fprq2 Mistral;}{\f41\fdecor\fcharset0\fprq2 Playbill;}{\f42\fdecor\fcharset0\fprq2 Stencil;}{\f43\fscript\fcharset0\fprq2 Vivaldi;}{\f44\fnil\fcharset0\fprq2 Arial MT Black;}
{\f45\froman\fcharset0\fprq2 Garamond MT;}{\f46\fswiss\fcharset0\fprq2 Gill Sans MT Ext Condensed Bold;}{\f47\fnil\fcharset0\fprq2 Mead Bold;}{\f48\fnil\fcharset0\fprq2 Mercurius Script MT Bold;}{\f49\fswiss\fcharset0\fprq2 Bookshelf Symbol 1;}
{\f50\fswiss\fcharset0\fprq2 Bookshelf Symbol 2;}{\f51\froman\fcharset2\fprq2 Bookshelf Symbol 3;}{\f52\fnil\fcharset2\fprq2 MS Reference 1;}{\f53\fnil\fcharset2\fprq2 MS Reference 2;}{\f54\froman\fcharset0\fprq2 Calisto MT;}
{\f55\fswiss\fcharset0\fprq2 Copperplate Gothic Light;}{\f56\fswiss\fcharset0\fprq2 Eurostile;}{\f57\fscript\fcharset0\fprq2 Lucida Blackletter;}{\f58\fscript\fcharset0\fprq2 Lucida Calligraphy;}{\f59\fswiss\fcharset0\fprq2 Lucida Sans;}
{\f60\fmodern\fcharset0\fprq1 Lucida Sans Typewriter;}{\f61\fdecor\fcharset0\fprq2 Peignot Medium;}{\f62\fnil\fcharset0\fprq2 AmericanText BT;}{\f63\fnil\fcharset0\fprq2 Americana BT;}{\f64\fnil\fcharset0\fprq2 Broadway BT;}
{\f65\fnil\fcharset0\fprq2 Charter BT;}{\f66\fnil\fcharset0\fprq2 CloisterBlack BT;}{\f67\fnil\fcharset0\fprq2 Cooper Blk BT;}{\f68\fnil\fcharset0\fprq2 DomCasual BT;}{\f69\fnil\fcharset0\fprq2 English157 BT;}{\f70\fnil\fcharset0\fprq2 Fraktur BT;}
{\f71\fnil\fcharset0\fprq2 Impress BT;}{\f72\fnil\fcharset0\fprq2 Informal011 BT;}{\f73\fnil\fcharset0\fprq2 PosterBodoni BT;}{\f74\fnil\fcharset0\fprq2 Raleigh DmBd BT;}{\f75\fnil\fcharset0\fprq2 Schadow BlkCn BT;}
{\f76\fnil\fcharset0\fprq2 Seagull Hv BT;}{\f77\fnil\fcharset0\fprq2 Staccato555 BT;}{\f78\fnil\fcharset0\fprq2 Umbra BT;}{\f79\fnil\fcharset0\fprq0 sD;}{\f80\fnil\fcharset0\fprq0 \'ff\'1d;}{\f81\fnil\fcharset0\fprq0 ;}
{\f82\fnil\fcharset0\fprq0 \'ff\'1e;}{\f83\froman\fcharset0\fprq2 Century Schoolbook;}{\f84\froman\fcharset0\fprq0 greek;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;
\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
{\stylesheet{\f4\lang2057 \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\qc \f5\fs30\cf2\lang2057 \sbasedon0\snext15 HelpSubTitle;}{\s16 \f3\lang2057 \sbasedon0\snext16 Code;}{\s17 \b\f5\fs30\ul\cf2\lang2057 \sbasedon0\snext17 HelpHead;}
{\s18\qc \b\f4\fs40\cf2\lang2057 \sbasedon0\snext18 HelpTitle;}{\s19 \f4\fs20\lang2057 \sbasedon0\snext19 footnote text;}{\s20 \i\f4\lang2057 \sbasedon0\snext20 Quote;}{\*\cs21 \additive\super \sbasedon10 footnote reference;}}{\info
{\author \'e2\'ff\'00\'00\'02\'00}{\creatim\yr1996\mo12\dy18\hr23\min59}{\version1}{\edmins178}{\nofpages0}{\nofwords0}{\nofchars0}{\vern49203}}\paperw11340\paperh31678\margl0\margr0\margt0\margb0 \widowctrl\ftnbj\aenddoc\hyphcaps0\formshade \fet0\sectd
\psz9\linex0\headery709\footery709\colsx709\endnhere {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s18\qc \b\f4\fs40\cf2\lang2057 {\cs21\super #{\footnote \pard\plain \s19
\f4\fs20\lang2057 {\cs21\super #} TransMan_Contents}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} Contents}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:0}}
Inform Translator's Manual
\par \pard\plain \f4\lang2057
\par \pard\plain \s15\qc \f5\fs30\cf2\lang2057 Graham Nelson
\par \pard \s15\qc 9th December 1996
\par \pard\plain \f4\lang2057
\par \trowd \trgaph108\trleft-108 \cellx993\cellx8414 \pard \intbl 1\cell \pard \intbl {\uldb Introduction}{\v TransMan_1}\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx993\cellx8414 \pard \intbl \cell {\uldb \cell }\pard \intbl \row \pard \intbl 2
\cell \pard \intbl {\uldb Teaching Inform to read your language}{\v TransMan_2}\cell \pard \intbl \row \pard \intbl   2.1\cell \pard \intbl {\uldb What is Informese?}{\v TransMan_2.1}\cell \pard \intbl \row \pard \intbl   2.2\cell \pard \intbl {\uldb
A grammar of Informese}{\v TransMan_2.2}\cell \pard \intbl \row \pard \intbl     (a)\cell \pard \intbl {\uldb Commands}{\v TransMan_2.2a}\cell \pard \intbl \row \pard \intbl     (b)\cell \pard \intbl {\uldb Verb phrases}{\v TransMan_2.2b}\cell \pard
\intbl \row \pard \intbl     (c)\cell \pard \intbl {\uldb Noun phrases}{\v TransMan_2.2c}\cell \pard \intbl \row \pard \intbl     (d)\cell \pard \intbl {\uldb Descriptors}{\v TransMan_2.2d}\cell \pard \intbl \row \pard \intbl     (e)\cell \pard \intbl {
\uldb Nouns}{\v TransMan_2.2e}\cell \pard \intbl \row \pard \intbl     (f)\cell \pard \intbl {\uldb Example}{\v TransMan_2.2f}\cell \pard \intbl \row \pard \intbl     (g)\cell \pard \intbl {\uldb Grammatical features not present in Informese}{\v TransMan_
2.2g}\cell \pard \intbl \row \pard \intbl   2.3\cell \pard \intbl {\uldb Gender, number and animation (GNA) of noun phrases}{\v TransMan_2.3}\cell \pard \intbl \row \pard \intbl   2.4\cell {\uldb The alphabet}{\v TransMan_2.4}\cell \pard \intbl \row
\pard \intbl   2.5\cell \pard \intbl {\uldb Plural dictionary words}{\v TransMan_2.5}\cell \pard \intbl \row \pard \intbl   2.6\cell \pard \intbl {\uldb Dealing with flexion in noun phrases using grammar tokens}{\v TransMan_2.6}\cell \pard \intbl \row
\pard \intbl \cell {\uldb \cell }\pard \intbl \row \pard \intbl   L.0\cell \pard \intbl {\uldb Organisation of language definition files}{\v TransMan_L.0}\cell \pard \intbl \row \pard \intbl   L.I.1\cell \pard \intbl {\uldb Version number and alphabet}{
\v TransMan_L.1.1}\cell \pard \intbl \row \pard \intbl   L.I.2\cell \pard \intbl {\uldb Compass objects}{\v TransMan_L.1.2}\cell \pard \intbl \row \pard \intbl   L.II.1\cell \pard \intbl {\uldb Informese vocabulary: miscellaneous}{\v TransMan_L.2.1}\cell
\pard \intbl \row \pard \intbl   L.II.2\cell \pard \intbl {\uldb Informese vocabulary: pronouns}{\v TransMan_L.2.2}\cell \pard \intbl \row \pard \intbl   L.II.3\cell \pard \intbl {\uldb Informese vocabulary: descriptors}{\v TransMan_L.2.3}\cell \pard
\intbl \row \pard \intbl   L.II.4\cell \pard \intbl {\uldb Informese vocabulary: numbers}{\v TransMan_L.2.4}\cell \pard \intbl \row \pard \intbl   L.III.1\cell \pard \intbl {\uldb Translating natural language to Informese}{\v TransMan_L.3.1}\cell \pard
\intbl \row \pard \intbl \cell {\uldb \cell }\pard \intbl \row \pard \intbl 3\cell \pard \intbl {\uldb Teaching Inform to write your language}{\v TransMan_3}\cell \pard \intbl \row \pard \intbl   3.1\cell \pard \intbl {\uldb The GNA of object names}{\v
TransMan_3.1}\cell \pard \intbl \row \pard \intbl   3.2\cell \pard \intbl {\uldb Flexion in object names}{\v TransMan_3.2}\cell \pard \intbl \row \pard \intbl \cell {\uldb \cell }\pard \intbl \row \pard \intbl   L.IV.1\cell \pard \intbl {\uldb
Default genders and contraction forms}{\v TransMan_L.4.1}\cell \pard \intbl \row \pard \intbl   L.IV.2\cell \pard \intbl {\uldb How to print: articles}{\v TransMan_L.4.2}\cell \pard \intbl \row \pard \intbl   L.IV.3\cell \pard \intbl {\uldb
How to print: direction names}{\v TransMan_L.4.3}\cell \pard \intbl \row \pard \intbl   L.IV.4\cell \pard \intbl {\uldb How to print: numbers}{\v TransMan_L.4.4}\cell \pard \intbl \row \pard \intbl   L.IV.5\cell \pard \intbl {\uldb
How to print: the time of day}{\v TransMan_L.4.5}\cell \pard \intbl \row \pard \intbl   L.IV.6\cell \pard \intbl {\uldb How to print: verbs}{\v TransMan_L.4.6}\cell \pard \intbl \row \pard \intbl   L.IV.7\cell \pard \intbl {\uldb How to print: menus}{\v
TransMan_L.4.7}\cell \pard \intbl \row \pard \intbl   L.IV.8\cell \pard \intbl {\uldb How to print: miscellaneous short messages}{\v TransMan_L.4.8}\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx993\cellx8414 \pard \intbl   L.IV.9\cell \pard
\intbl {\uldb How to print: LibraryMessages}{\v TransMan_L.4.9}\cell \pard \intbl \row \pard
\par \pard Written by Graham Nelson
\par Translated to Help file format by Nicholas Daley
\par
\par \pard If there are any errors or problems in this file that aren\rquote t present in other versions, please contact me at [email protected]
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 1  Introduction}} {\cs21\super +
{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:1}} 1.  Introduction
\par \pard\plain \f4\lang2057
\par \pard\plain \s20 \i\f4\lang2057      "The corresponding Kivunjo construction [to the English dative]
\par \pard \s20      is called the applicative... [it] fits entirely inside the verb,
\par      which has seven prefixes and suffixes, two moods and fourteen
\par      tenses; the verb agrees with its subject, its object and its
\par      benefactive nouns, each of which has sixteen genders."
\par \pard\plain \f4\lang2057      -- Steven Pinker, "The Language Instinct".  (Kivunjo is spoken
\par \pard         only in certain villages on the slopes of Mount Kilimanjaro.)
\par
\par \pard\plain \s20 \i\f4\lang2057      "_It_, hell.  She had _Those_."
\par \pard\plain \f4\lang2057      -- Dorothy Parker, reviewing a book called "It", whose hero and
\par         heroine supposedly had _It_, or sex appeal.
\par \pard
\par
\par \pard Designing a computer interface to cope with the full range of human languages is far from simple.  Three things make matters easier for Inform:
\par \pard
\par \trowd \trgaph108\trleft-108 \cellx426\cellx8414 \pard \intbl (a)\cell \pard \intbl Most languages form imperative commands in a similar fashion to English (perhaps Chomsky's Universal Grammar of human language, if there is one, allows little variation).
\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx426\cellx8414 \pard \intbl (b)\cell \pard \intbl Inform is probably only going to be used with Romance, and perhaps a few Ugric languages: relations between these are close for historical reasons.
\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx426\cellx8414 \pard \intbl (c)\cell \pard \intbl Inform's internal workings (its parser and verb library) deal only with a small part of grammar: present tense, imperative verbs and so on.\cell
\pard \intbl \row \pard
\par \pard The present systems have bee
n made as flexible as reasonably possible, but have also made compromises.  There will still be languages which it is extremely difficult to translate Inform to (Hebrew, for instance, where vowels are conventionally omitted, to leave an ambiguous text whi
ch must be understood in context).  English is a non-inflected language.  That is, one in which word endings tend not to vary according to grammatical situation:
\par \pard
\par \pard\plain \s16 \f3\lang2057     take a brown dog
\par \pard \s16     take the brown dog
\par     give a biscuit to the brown dog
\par \pard\plain \f4\lang2057
\par \pard In German, th
e corresponding words to "brown" and "dog" would each have inflected to agree with the definite or indefinite article, and "to the brown dog" would be expressed by writing "brown dog" in the dative case, inflecting it again.  (Even English has a few infle
ctions, inherited from Old English -- which was an inflected language: I do, you do, he does; I have, you have, he has.)
\par \pard
\par \pard Most languages are more heavily inflected than English, some (like Kivunjo or Finnish) crushingly so.  Yet the Inform parser is really modelled on a non-inflected language.  A translator will face two basic tasks:
\par \pard
\par \trowd \trgaph108\trleft-108 \cellx426\cellx8414 \pard \intbl (a)\cell \pard \intbl Translating many small pieces of text, which should be easy but probably quite tedious.\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx426\cellx8414 \pard
\intbl (b)\cell \pard \intbl Writing short pieces of code, and grammar tokens, to try to remove inflections, stripping out prefixes and suffixes from words as needed.\cell \pard \intbl \row \pard
\par \pard The translator will probably want to compromise in a few places, omitting tricky but not really necessary features of the language.  For instance, in German, adjectives take forms agreeing with w
hether their noun takes a definite or indefinite article:
\par \pard
\par \trowd \trgaph108\trleft-108 \cellx2694\cellx11448 \pard\plain \s20\li720\intbl \i\f4\lang2057 ein gro\'dfer Mann\cell \pard\plain \intbl \f4\lang2057 = a tall man\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2694\cellx11448 \pard\plain
\s20\li720\intbl \i\f4\lang2057 der gro\'dfe Mann\cell \pard\plain \intbl \f4\lang2057 = the tall man\cell \pard \intbl \row \pard
\par \pard This is a feature which we cannot compromise on.  But German also has a "neutral" form for adjectives, used in sentences like
\par \pard
\par \trowd \trgaph108\trleft-108 \cellx2694\cellx11448 \pard\plain \s20\li720\intbl \i\f4\lang2057 Der Mann ist gro\'df\cell \pard\plain \intbl \f4\lang2057 = The man is tall\cell \pard \intbl \row \pard
\par \pard Now it could be argued that if the parser asks a question like
\par
\par \pard\plain \s16 \f3\lang2057      Whom do you mean, the tall man or the short man?
\par \pard\plain \f4\lang2057
\par \pard then the player ought to be able to reply "gro\'df".  I think this just isn't worth the trouble.  As another e
xample from German, is it essential for the parser to recognise commands put in the polite form when addressed to somebody other than the player?  For instance,
\par \pard
\par \trowd \trgaph108\trleft-108 \cellx4111\cellx11448 \pard\plain \s20\li720\intbl \i\f4\lang2057 freddy, \'d6ffne den ofen\cell \pard\plain \intbl \f4\lang2057 =  Freddy, open the oven\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx4111
\cellx11448 \pard\plain \s20\li720\intbl \i\f4\lang2057 herr kr\'dcger, \'d6ffnen sie den ofen\cell \pard\plain \intbl \f4\lang2057 =  Mr Krueger, open the oven\cell \pard \intbl \row \pard
\par \pard demonstrate forms to be used if Freddy is a familiar friend and Mr Krueger a mere acquaintance.  A translator might go to the trouble of implementing this (it's not impossible), but I suspect I'd not bother, and simply tell players alway
s to use the familiar form.
\par \pard
\par \pard
The translator will also face choices.  I can imagine two rather different translations into French, one which expects players to type commands using accented letters, and one which expects them to ignore accents and simply type A to Z.  (After all, some
capitalised French titles omit accents, and accents can be a nuisance on some computer keyboards.)
\par \pard
\par \pard Another range of choices concerns how the computer is to be addressed.  Many languages have different forms of address to people
who are familiar and to strangers, as in the example of Freddy and Mr Krueger.  Is the computer familiar?  I suggest so, but a translator is free to disagree.  For that matter, does the player address the computer or the main character of the game?  It d
epends on one's point of view.  In English it makes no difference, but there are languages where an imperative verb agrees with the gender of the person being addressed.  Is the computer male?  Is it still male if the game's main character is female?

\par \pard
\par \pard Finally, there are also dialect forms.  A French translation will be almost, but not quite, the same as a Francophone Canadian or Belgian one.
\par \pard
\par \pard I suggest that for such choices, the translator may want to write his language definition file to cope with either possibility.  For example, something like
\par \pard
\par \pard\plain \s16 \f3\lang2057     #ifdef DIALECT_FRANCOPHONE;
\par \pard \s16     print "septante";
\par     #ifnot;
\par     print "soixante-dix";
\par     #endif;
\par \pard\plain \f4\lang2057
\par \pard would enable the same definition file to be used by Quebecois authors and paid-up members of the Academie Fran
caise alike.  (The "English.h" file already has such a constant: DIALECT_US, which uses US spellings and number conventions in the very few instances where they differ from English ones.)
\par \pard
\par Would anyone care to write a language definition file for Black English Vernacular?
\par
\par
\par \pard Inform's library 6/3 comes as a set of 8 files, not 7 as in library 6/2: the new file is called "English.h" and is a definition of the English language.  A new ICL path variable (new in Inform 6.10, that is) called "language_name" allows
this to be changed:
\par \pard
\par \pard\plain \s16 \f3\lang2057     inform +language_name=French voliere
\par \pard\plain \f4\lang2057
\par \pard compiles "voliere" using "French.h" in place of "English.h".
\par
\par \pard Files like "French.h" and "English.h" are called "language definitions", and this manual tells you how to draft a new language definition file.
\par \pard
\par \pard My ambition is for a stock of language definitions to be built up and publically archived.  The author of an Inform game will probably still have to speak English (after all, the manuals are in English, and so is text produced by the special
debugging verbs) but players will not.  In any case, there have been fringe benefits to this project -- the English Inform library is becoming more sensitive to number and "a" becoming "an" before a vowel, for instance.
\par \pard
\par \pard Translators need to produce one other file: a translation of the "Grammar.h" file into their own languages.  I hope to use the conventional filenames:
\par \pard
\par \pard\plain \s16 \f3\lang2057     FrenchG.h
\par \pard \s16     GermanG.h
\par \pard\plain \f4\lang2057
\par \pard and so forth to refer to these.
\par
\par
\par \pard I should like to thank the following people, whose thoughtful replies to th
e discussion document have improved this one: Torbj|rn Andersson, Joachim Baumann, Paul David Doherty, Bjorn Gustavsson, Aapo Haapanen, JP Ikaheimonen, Bob Newell "mon oncle", Linards Ticmanis.  How else could I have learned the palindromic Finnish word f
or soap dealer, "saippuakauppias"?  Finally, I must also thank Jose Luis Diaz, whose translation of the Inform 5/12 library into Spanish first introduced me to the complexity of the problem.
\par \pard
\par \pard Torbj|rn made the helpful suggestion that in the French version o
f "Curses", perhaps the player could look for a tourist map of London.  Seriously, if anyone out there would like to translate any of my games, please feel free to get in touch.  I suspect a translation of "Advent" might be a better place to begin.
\par \pard
\par \pard \qr Graham Nelson
\par 5th December 1996
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2  Teaching Inform to read your language
}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:2}} 2.  Teaching Inform to read your language
\par \pard\plain \f4\lang2057
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.1  What is Informese?}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:21}} 2.1  What is Informese?
\par \pard\plain \f4\lang2057
\par \pard The Inform parser understands a simple language, modelled on a small part of English, which we will call "Informese".
\par \pard
\par \pard The first, fairly easy, job o
f the translator is to change the vocabulary of Informese (the dictionary, so to speak) so that it matches the new language.  For instance, in English, Informese uses words like "other" and "another" in the category of "other-words" (see below).  A transl
ator to French will probably change these to "autre".
\par \pard
\par \pard Once this is done, the Inform parser will understand commands which are neither good English nor, at least in some cases, good French.  For example:
\par \pard
\par \pard\plain \s20 \i\f4\lang2057    jetez le boite dans lui
\par \pard\plain \f4\lang2057
\par \pard is good Informese (using French vocabulary) but it is not good French -- the correct French would be
\par
\par \pard\plain \s20 \i\f4\lang2057    jetez le boite dedans
\par \pard\plain \f4\lang2057
\par \pard
where the word "dedans" is a part of French grammar which doesn't correspond to a single part of Informese.  So the second job of the translator is to write an Inform program to translate what the player typed (real French) into what the parser can unders
tand (French-vocabulary Informese).  For most Romance languages, only a few simple transformations will be needed, but for some heavily inflected or aggl
utinizing languages the translation process may need a substantial program.  This is probably the hardest job an Inform translator has.
\par \pard
\par \pard
The biggest difference between Informese and non-English languages is that Informese does not glue together different words which belong to different grammatical constructs in Informese (as in the above case, where Informese would not glue together "dans"
and "lui" into "dedans").  But this is common in non-English languages.  (E.g., Spanish "cogela" ("take it") must be translated into "coge la" to become good Informese.)
\par \pard
\par \pard
Better news is that Informese can be configured automatically to have up to three genders and to recognise cases of nouns, even though these features lie dormant in the English parser.  Informese is not checked in absolute detail by the parser: the player
can usually get away with typing the wrong gender for something in French, for instance (as in "la ciel").  But the parser is not ignoring gender: if the player refers to an object as simply "la", the par
ser will match it against something whose short name is female singular.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2  A grammar for Informese}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:22}} 2.2  A grammar for Informese
\par \pard\plain \f4\lang2057
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2a}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (a)  Commands}} {\cs21\super +
{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:221}} 2.2(a) Commands
\par \pard\plain \f4\lang2057
\par \pard A command to an Inform game should be one of:
\par
\par \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl oops <word>\cell \pard \intbl correct the last command by putting the <word> in to replace whatever seemed to be incorrect\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2835
\cellx11448 \pard \intbl <action>\cell \pard \intbl perform this action\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl <noun phrase>, <action>\cell \pard \intbl tell someone else to perform the action\cell \pard
\intbl \row \pard
\par \pard An <action> consists of a sequence of verb phrases, divided up by full stops or "then-words": a "then-word" is a word like "then" (in English).  E.g.,
\par \pard
\par \pard\plain \s16 \f3\lang2057     take sword. east. put sword in stone
\par \pard\plain \f4\lang2057
\par \pard
is broken into the obvious sequence of three verb phrases, each of which is parsed and acted on in turn.  (It's important not to parse them all at once: the meaning of the noun phrase "stone" depends on where the player is, and by the time this command is
reached, the player will not be where he is now.)
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2b}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (b)  Verb phrases}} {\cs21\super
+{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:222}}2.2(b) Verb phrases
\par \pard\plain \f4\lang2057
\par \pard A verb phrase is either
\par
\par \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl again\cell \pard \intbl the same as the most recent verb phrase typed in\cell \pard \intbl \row \pard
\par \pard or takes the form
\par
\par \pard\plain \s16 \f3\lang2057     <imperative verb> <grammar line>
\par \pard\plain \f4\lang2057
\par \pard
The "imperative" is the form of the verb used for orders or instructions: e.g., "open" in "open the window" (though English is a poor example since the imperative looks the same as the infinitive); "ouvrez" in "ouvrez la fenetre" (French).  In most langua
ges, even some in which verbs usually follow objects (e.g. Latin), the imperative verb comes at the start of a verb phrase.  If not, some coding will be needed (see later).
\par \pard
\par It is possible for the verb to be more than one word, using an UnknownVerb routine (for example).
\par
\par \pard Grammar lines are documented elsewhere, and most Inform programmers feel familiar with them.  Each token has one of four kinds of outcome:
\par \pard
\par \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl Outcome:\cell \pard \intbl Example tokens producing this:\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl a "noun phrase"\cell \pard \intbl
noun, multiheld, scope=MyScope, edible, creature, noun=CagedCreature, etc.\cell \pard \intbl \row \pard \intbl a "preposition"\cell \pard \intbl 'into', 'against'\cell \pard \intbl \row \pard \intbl a number\cell \pard \intbl number\cell \pard \intbl
\row \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl a chunk of unparsed text\cell \pard \intbl special, topic\cell \pard \intbl \row \pard
\par \pard (A general parsing routine may have any of these four outcomes.)  Note that the term "preposition" is being used here to
mean any word written in quotes as a grammar token.  This usually corresponds to the grammatical meaning of "preposition" (for instance, "into" and "against" are both prepositions in English) but need not do so.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2c}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (c)  Noun phrases}} {\cs21\super
+{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:223}}2.2(c) Noun phrases
\par \pard\plain \f4\lang2057
\par \pard A "noun phrase" is a string of words which refer to a single object or collection of objects in the game, with more or less exactness.  In English, typical Inform noun phrases are:
\par \pard
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}it
\par {\pntext\pard\plain\f1 \'b7\tab}rucksack
\par {\pntext\pard\plain\f1 \'b7\tab}shield, dagger
\par {\pntext\pard\plain\f1 \'b7\tab}the blue box
\par {\pntext\pard\plain\f1 \'b7\tab}a box and the compass
\par {\pntext\pard\plain\f1 \'b7\tab}nine bronze coins
\par {\pntext\pard\plain\f1 \'b7\tab}everything except the green crown
\par {\pntext\pard\plain\f1 \'b7\tab}all the swords
\par \pard
\par \pard (Thus a "noun phrase" in Inform terms is any piece of text which can match against one of the grammar tokens "noun", "multi", etc.)
\par \pard
\par Inform divides up noun phrases into three kinds of word:
\par
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"Connectives" are conjunctions or disjunctions, that is, words which can join noun phrases together.  The Inform parser regards a comma as a connective, and (in English) also recognises "and", "but" and "except".
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Descriptors" are words which clarify the noun to follow, such as "the", "every", "my" or "all".
\par {\pntext\pard\plain\f1 \'b7\tab}"Nouns" are words matched against particular game objects.
\par \pard
\par \pard Although the expected form is
\par
\par \pard\plain \s16 \f3\lang2057          noun phrase
\par \pard \s16          |         |
\par          |         |
\par      descriptors  nouns
\par \pard\plain \f4\lang2057
\par \pard (note that descriptors are expected to precede nouns), in fact both halves are optional:
\par
\par \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl the balloon\cell \pard \intbl descriptor, noun\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl all\cell \pard \intbl descriptor\cell \pard \intbl \row
\trowd \trgaph108\trleft-108 \cellx2835\cellx11448 \pard \intbl train\cell \pard \intbl noun\cell \pard \intbl \row \pard
\par \pard are all legal Inform noun phrases, and even text like
\par
\par     take a
\par
\par is a legal Inform verb phrase.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2d}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (d)  Descriptors}} {\cs21\super +
{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:224}}2.2(d) Descriptors
\par \pard\plain \f4\lang2057
\par \pard There are five kinds of descriptor, as follows:
\par
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"Articles" are words indicating whether a particular object is being referred to, or merely one of a range.  Thus there are two kinds of article, "definite" and "indefinite".  E.g., English has four articles:
\par \pard
\par \pard\plain \s16 \f3\lang2057            "the"               definite
\par \pard \s16            "a", "an", "some"   indefinite
\par {\pntext\pard\plain\f1 \'b7\tab}\pard\plain \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\f4\lang2057
"All-words" are words which behave like the English word "all", that is, which match against a whole range of objects.  (To Informese this is effectively a "pluralising article" -- it behaves like an article meaning "
expect a collection of things to follow".  In this respect, Informese behaves like some natural languages: Tagalog, for instance.)
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"Other-words" are words behaving like "other", which Inform interprets as "other than the one I am holding".  Thus, if the player is holding a sword in a room where there's also a sword on the floor, then "examine other sword" would refer to the one on th
e floor.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Demanding numbers" are numbers like "nine" in "nine bronze coins", which demand that a certain number of items are needed.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"Possessive adjectives" are adjectives indicating ownership by someone or something whose meaning is held in a pronoun, such as "my" (belonging to "me") or "his" (belonging to "him") or "son" (French: belonging to "lui").  Note that they are adjectives an
d not pronouns.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2e}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (e)  Nouns}} {\cs21\super +
{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:225}}2.2(e) Nouns
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 There are three kinds of noun, as follows:
\par
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"Names" are words matched against particular objects.  Usually (that is, unless the object in question has a "parse_name" routine attached), these will just be the words found in an object's "name" property.  E.g., for the object defined as:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057            Object -> "blue box"
\par \pard \s16              with name 'blue' 'box';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284
the words "blue" and "box" are both names.  Note that the Inform parser does not make the grammatical distinction between nouns and adjectives. This makes it simpler and more efficient (though not all designers agree that it's a good idea, and some write
parse_name routines to keep nouns and adjectives separate -- see the "Designer's Manual" for an example of how to do this).
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"Me-words" are words which behave like the English word "me", that is, which refer to the player-object.  (Grammatically, such words are examples of relative pronouns, but the Inform parser treats them differently from other pronouns.)  Note that they ref
er to the player, not the "actor" (the person to whom the command is directed) -- in "mark, give me the bomb", "me" refers to the speaker, not to Mark.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Pronouns" are words which stand in the place of nouns and can only be understood with reference back
to what has previously been said. To parse "put it on the table", Inform has to remember recent events: if the previous command was "take sword", for instance, then "it" will probably be understood as "the sword".
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2f}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (f)  Example}} {\cs21\super +
{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:226}}2.2(f) Example
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Suppose the verb "put" has a grammar line reading
\par
\par \pard\plain \s16 \f3\lang2057     * multiexcept 'into' noun ->
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (as indeed it does in the English "grammar.h" library file).  Then the text
\par
\par \pard\plain \s16 \f3\lang2057     conan, put all the swords into box
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 is parsed as
\par \pard\plain \s16 \f3\lang2057                command
\par \pard \s16                   |
\par                 order
\par                /  :  \\
\par               /   :   \\
\par     noun phrase   :    action
\par               |   :       |
\par             nouns :    verb phrase
\par               |   :   /           \\
\par             name  :  /             \\
\par               :   : verb      grammar line____________________
\par               :   :  :             |             |           |
\par               :   :  :        noun phrase   preposition  noun phrase
\par               :   :  :        |         |        :                 |
\par               :   :  :   descriptors  nouns      :               nouns
\par               :   :  :     |      |     |        :                 |
\par               :   :  : all-word article name     :                name
\par               :   :  :     :      :     :        :                 :
\par             conan , put   all    the   swords   into              box
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.2g}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.2 (g)
Grammatical features which Informese does not have}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:227}}2.2(g) Grammatical features which Informese does not have
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Of course there are endless points of grammar which Informese doesn't have, but here are some of the more surprising ones:
\par \pard \tx284
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}adverbs: "run quic
kly east" would not normally be understood, unless of course the designer arranged for "run quickly" to be effectively a different verb from "run" (e.g. by writing some grammar lines beginning with the token 'quickly', and others not beginning that way).

\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
adjectives and nouns are not distinguished from each other when "names" are being parsed; objects are not normally named by description of their circumstances -- e.g., "the box on the floor" or "the priest's hat".  This is good news for translators, as it
avoids the need to work out a formal system of genitives (in German, for instance).  Designers can still define objects like
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057         Object -> "priest's hat"
\par \pard \s16           with name 'hat' 'priest^s';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284     that is, making genitive forms of words (e.g. "priest's") names on the same basis as the noun ("hat").
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
demonstrative adjectives ("this" and "that") are recognised by the English version of Inform, but hardly anybody knows this or makes use of it.  English is unusually simple in having only two d.a.'s, "this" a
nd "that": e.g. Spanish has three forms, for "this", "that" (nearby) and "that" (far away"), and then has masculine, feminine, singular and plural versions of each; and the structure of "celui-ci" and "celui-la" in French is too complex to be worth the ef
fort of parsing.  So I simply propose not to translate this feature to languages other than English.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}other kinds of pronoun, such as:
\par \pard \li284\tx284 -    subject (nominative) pronouns ("I" in "I am happy");
\par \pard \li284\tx284 -    interrogative pronouns ("What" in "What are you doing?");
\par -    demonstrative pronouns ("this" or "that" in "eat that");
\par -    possessive pronouns ("mine" in "Mine is a big car").
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
pronominal adverbs: English does not have these.  A pronominal adverb indicates that a verb should do something with, towards, in, etc. a noun whose meaning is that of a particular pronoun.  For example, "dessous" in French ("under it"), or "darauf" (and
"davon", etc.) in German.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.3}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
2.3  Gender, number and animation (GNA) of noun phrases}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:23}} 2.3  Gender, number and animation (GNA) of noun phrases
\par \pard\plain \tx284 \f4\lang2057
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Gender": in most European languages, nouns div
ide up into masculine, feminine (or sometimes neuter) forms.  Gender may be the only way to distinguish otherwise identical nouns, as in French: "le faux", the forgery, "la faux", the scythe.  There may be no satisfactory way to determine the gender of a
noun by any automatic rules (as in German).  Inform assumes there are no more than three genders.  Internally these are called male, female and neuter (though, as we shall see, they do not need to be used as such).
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Number": singular ("the hat") or plural (
"the grapes").  Individual objects in Inform games can have names of either number.  (Languages with more than two numbers are rare -- Tagalog, or Filipino, has a third for "pair of".  Inform does not directly support this.)
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Animation": Inform distinguishes between the animate (people and higher animals) and the inanimate (objects, plants, lower animals).

\par \pard \tx284
\par \pard \tx284 Combining these three possibilities gives 12 possible combinations:
\par
\par \pard\plain \s16 \f3\lang2057     (3 genders) * (2 numbers) * (2 animations) = 12
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 The combination is called the GNA of a noun phrase.  Inform uses this concept both when parsing and when printing out names of objects.  Internally, GNAs are represented by numbers between 0 to 11:
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx851\cellx1418\cellx2694\cellx3686\cellx4678 \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 0\cell \pard \intbl\tx284 animate\cell \pard \intbl\tx284 singular\cell male\cell \pard \intbl \row \trowd \trgaph108\trleft-108
\cellx851\cellx1418\cellx2694\cellx3686\cellx4678 \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 1\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell female\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 2\cell \pard
\intbl\tx284 \cell \pard \intbl\tx284 \cell neuter\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 3\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 plural\cell male\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard
\qr\intbl\tx284 4\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell female\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 5\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell neuter\cell \pard \intbl \row \pard
\intbl\tx284 \cell \pard \qr\intbl\tx284 6\cell \pard \intbl\tx284 inanimate\cell \pard \intbl\tx284 singular\cell male\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 7\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell female
\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 8\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell neuter\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 9\cell \pard \intbl\tx284 \cell \pard
\intbl\tx284 plural\cell male\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 10\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell female\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx851\cellx1418\cellx2694
\cellx3686\cellx4678 \pard \intbl\tx284 \cell \pard \qr\intbl\tx284 11\cell \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell neuter\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 Not all possible GNAs will occur in all natural languages.  (In English, cases 6, 7, 9 and 10 never occur.  In French, 2, 5, 8 and 11 never occur.)
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.4}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.4  The alphabet}} {\cs21\super +
{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:24}} 2.4  The alphabet
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
Z-machine interpreters are now available for almost all machines which obey the Z-Machine Standard Document (November 1995), version 0.2.  Among other things this defined a standard set of character codes for accented and non-English letters, based loosel
y on the ISO Latin 1 convention.  Inform 6 supports this set of accents and it may be useful to reprint the appropriate section of the Inform Designer's Manual (third edition, 1996) here:
\par \pard \tx284
\par
\par \pard \tx284 "Most accented characters are written as @, followed by an accent marker, then the letter on which the accent appears:
\par \pard \tx284
\par    @^   put a circumflex on the next letter: a,e,i,o,u,A,E,I,O or U
\par    @'   put an acute on the next letter: a,e,i,o,u,y,A,E,I,O,U or Y
\par    @`   put a grave on the next letter: a,e,i,o,u,A,E,I,O or U
\par    @:   put a diaeresis on the next letter: a,e,i,o,u,A,E,I,O or U
\par    @c   put a cedilla on the next letter: c or C
\par    @~   put a tilde on the next letter: a,n,o,A,N or O
\par    @\\   put a slash on the next letter: o or O
\par    @o   put a ring on the next letter: a or A
\par
\par In addition, there are a few others:
\par
\par    @ss  German sz
\par    @<<  continental European quotation marks
\par    @>>
\par    @ae  ligatures
\par    @AE
\par    @oe
\par    @OE
\par \pard \tx284    @th  Icelandic accents
\par \pard \tx284    @et
\par    @Th
\par    @Et
\par    @LL  pound sign
\par    @!!  Spanish (upside-down) exclamation mark
\par    @??  Spanish (upside-down) question mark
\par
\par For instance,
\par
\par \pard\plain \s16 \f3\lang2057     print "@AEsop's @oeuvres en fran@ccais, mon @'el@`eve!";
\par \pard \s16     print "Na@:ive readers of the New Yorker will re@:elect Mr Clinton.";
\par     print "Carl Gau@ss first proved the Fundamental Theorem of Algebra.";
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Accented characters can also be referred to as constants, like other characters.  Just as 'x' represents the character lower-case-X, so '@^A' represents capital-A-circumflex."
\par \pard \tx284
\par           (Inform Designer's Manual, third edition (1996), section 1.14)
\par
\par
\par \pard \tx284 As from Inform 6.10, accents can be used equally in dictionary words.  This is particularly important in languages such as Finnish, where '@:a' and '@:o' are significantly different characters from 'a' and 'o':
\par \pard \tx284
\par \pard    '{\i vaara}' means "danger"
\par \pard    '{\i v@:a@:ar@:a}' means "wrong"
\par \pard \tx284
\par \pard \tx284 This raises an awkward technicality.  Dictionary words are stored internally to a "resolution" of 9 Z-characters: that is, only the first 9 Z-characters are looked at, so that
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    'chrysanthemum'    is stored as   'chrysanth'
\par \pard \s16    'chrysanthemums'   is stored as   'chrysanth'
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 This is normally no problem, but unfortunately Z-characters are not the same as letters.  That is,
\par
\par \trowd \trgaph108\trleft-108 \cellx1843\cellx5529 \pard \intbl\tx284 letters A to Z\cell \pard \intbl\tx284 take up 1 Z-character each\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1843\cellx5529 \pard \intbl\tx284 accented letters\cell \pard
\intbl\tx284 normally take 4 Z-characters each\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 and this is a serious problem:
\par
\par \trowd \trgaph108\trleft-108 \cellx2268\cellx3899\cellx5530 \pard\plain \s16\intbl \f3\lang2057 't@'el@'ecarte'\cell \pard\plain \intbl\tx284 \f4\lang2057 is stored as\cell \pard\plain \s16\intbl \f3\lang2057 't@'el'\cell \pard\plain \intbl \f4\lang2057
\row \trowd \trgaph108\trleft-108 \cellx2268\cellx3899\cellx5530 \pard\plain \s16\intbl \f3\lang2057 't@'el@'ephone'\cell \pard\plain \intbl\tx284 \f4\lang2057 is stored as\cell \pard\plain \s16\intbl \f3\lang2057 't@'el'\cell \pard\plain \intbl
\f4\lang2057 \row \pard \tx284
\par \pard \tx284
(there are not even enough of the 9 Z-characters left to encode the second e-acute, let alone the 'c' or the 'p' which would distinguish the two words).  Inform therefore provides a mechanism to make up to about 10 common accents cheaper to use, in that t
hey then take only 2 Z-characters each, not 4.
\par \pard \tx284 If this mechanism were used for '@'e',
\par
\par \trowd \trgaph108\trleft-108 \cellx2268\cellx4395\cellx6521 \pard\plain \s16\intbl \f3\lang2057 't@'el@'ecarte'\cell \pard\plain \intbl\tx284 \f4\lang2057 would be stored as\cell \pard\plain \s16\intbl \f3\lang2057 't@'el@'ecar'\cell \pard\plain \intbl
\f4\lang2057 \row \trowd \trgaph108\trleft-108 \cellx2268\cellx4395\cellx6521 \pard\plain \s16\intbl \f3\lang2057 't@'el@'ephone'\cell \pard\plain \intbl\tx284 \f4\lang2057 would be stored as\cell \pard\plain \s16\intbl \f3\lang2057 't@'el@'epho'\cell
\pard\plain \intbl \f4\lang2057 \row \pard \tx284
\par \pard \tx284 Declaring accented characters as "cheap" in this way is one of the first tasks of a language definition file (see L.1 below).
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.5}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 2.5  Plural dictionary words}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:25}} 2.5  Plural dictionary words
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 A dictionary word written in the form
\par
\par \pard\plain \s16 \f3\lang2057    'crowns//p'
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 is considered to be plural.  Here, plural means "can refer to more than one Inform object": you wouldn't set this for the word 'grapes' if it referred to a single object representing a bunch of grapes, for instance.
\par \pard \tx284
\par This makes it much simpler to get plurals working.  For example,
\par
\par \pard\plain \s16 \f3\lang2057    Class Crown with name 'crown' 'crowns//p';
\par \pard \s16    Crown with name 'red';
\par    Crown with name 'green';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 which has the following useful result:
\par
\par \pard\plain \s16 \f3\lang2057    > GET CROWN
\par \pard \s16    Which do you mean, the red crown or the green crown?
\par
\par    > GET CROWNS
\par    red crown: Taken.
\par    green crown: Taken.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_2.6}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
2.6  Dealing with flexion in noun phrases using grammar tokens}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:26}} 2.6  Dealing with flexion in noun phrases using grammar tokens
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Linguists use the following terms for "flexion", the ways that words change according to the words surrounding them:
\par
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"inflection": a variable ending for a word, e.g., "a peach" but "an apple".
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"agreement": when the inflection of one word is changed to match another word which it goes with.  E.g. "grand maison" but "grande dame" (French), where the inflection on "grand" agrees with the gender of the noun it is being applied to.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"affix": part of a word which is attached either at the beginning ("prefix"), the end ("suffix") or somewhere in the middle ("infix") of the ordinary word (the "stem
") to indicate e.g. person or gender of the objects attached to a verb.  The affix often plays a part that an entirely separate word would play in English.  For instance, "donnez-lui" (French: "give to him"), where the suffix "lui" is helpfully hyphenated
, or "cogela" (Spanish: "take it"), where there is no convenient hyphen.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"enclitic": an affix, usually a suffix, meaning "too" or "and" in English: e.g., "-que" (Latin), "-kin" (Finnish).
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"agglutinization": the practice of composing many affixes to a single
word, so that it may even become an entire sentence: e.g., "kirjoitettuasi" (Finnish: "after you had written"), and Hebrew is also agglutinizing.
\par \pard \tx284
\par \pard \tx284 Enclitics, agglutinization and affixes will have to be undone when translating the source language into Informese, and we'll come to that later.  It is also essential to define:
\par \pard \tx284
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}"Case": in many languages nouns or pronouns are written differently according to their usage in a sentence: e.g. in German
\par \trowd \trgaph108\trleft-108 \cellx2268\cellx4707\cellx7513 \pard \li720\intbl\tx284 Case of "him"\cell \pard \intbl\tx284 English\cell \pard \intbl\tx284 German\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2268\cellx4707\cellx7513 \pard
\li720\intbl\tx284 accusative\cell \pard \intbl\tx284 put the frog on him\cell \pard\plain \s20\intbl \i\f4\lang2057 leg den frosch auf ihn\cell \pard\plain \intbl \f4\lang2057 \row \trowd \trgaph108\trleft-108 \cellx2268\cellx4707\cellx7513 \pard
\li720\intbl\tx284 dative\cell \pard \intbl\tx284 take the frog from him\cell \pard\plain \s20\intbl \i\f4\lang2057 nimm den frosch von ihm\cell \pard\plain \intbl \f4\lang2057 \row \pard \tx284
\par \pard \li284\tx284 and nouns take four cases, which articles tend to agree with:
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx2127\cellx3686 \pard\plain \s20\li720\intbl \i\f4\lang2057 der Russe\cell \pard\plain \intbl\tx284 \f4\lang2057 nominative\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2127\cellx3686 \pard\plain
\s20\li720\intbl \i\f4\lang2057 dem Russen\cell \pard\plain \intbl\tx284 \f4\lang2057 dative\cell \pard \intbl \row \pard\plain \s20\li720\intbl \i\f4\lang2057 des Russen\cell \pard\plain \intbl\tx284 \f4\lang2057 genitive\cell \pard \intbl \row \trowd
\trgaph108\trleft-108 \cellx2127\cellx3686 \pard\plain \s20\li720\intbl \i\f4\lang2057 den Russen\cell \pard\plain \intbl\tx284 \f4\lang2057 accusative\cell \pard \intbl \row \pard \tx284
\par \pard \li284\tx284
The extreme example is Finnish, with about 30 cases (depending on what one calls a "case": in effect, a wide range of English prepositional phrases like "into the water" would be written as just the noun phrase "water" with a postpositional ending meaning
"into", and which we could think of as a case).
\par \pard \tx284
\par \pard \tx284
\par \pard \li284\tx284 The words entered into an object's "name" property should normally be accusative.  This will be fine for noun phrases parsed in grammar lines like
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Verb 'take'
\par \pard \s16        * noun                       -> Take;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 However, consider translating the following grammar line:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Verb 'give'
\par \pard \s16        * noun 'to' noun             -> Give;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 What is really going on is
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     <give-verb> <accusative object> <dative object>
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 where, in English, the dative case survives only in the use of the word "to".  Thus the sentence would be better understood as:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     give  {\ul the banana}  {\ul to the monkey}
\par \pard \s16           accusative     dative
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 and you would probably want to rewrite the grammar line as
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Verb 'give'
\par \pard \s16        * noun dativenoun            -> Give;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 where "dativenoun" is some token meaning "like noun, but in the dative case".  For example, the German form might be
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Verb 'gib'
\par \pard \s16        * noun dativenoun            -> Give
\par        * dativenoun noun            -> Give;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 (since German does not insist that the objects come in any particular order), and then
\par \pard \tx284
\par \pard\plain \s20\li284\tx284 \i\f4\lang2057     gib dem maedchen die blumen
\par \pard \s20\li284\tx284     gib die blumen dem maedchen
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 will each be understood as asking to give the flowers to the girl.
\par \pard \tx284
\par \pard \tx284
\par \pard \li284\tx284
Unfortunately Inform does not come with a token called "dativenoun" built in, so you have to write one.  This will be an example of a "general parsing routine", about which there is a great deal of documentation in the Designer's Manual.  GPRs have been e
nhanced since the Designer's Manual (third edition) was published, though, so here's a recap:
\par \pard \tx284
\par \pard \li284\tx284
A general parsing routine should look at words from the current word (the one numbered "wn" onwards), and may match one or more words as being understood (in which case "wn" should be left pointing to the next word not matched), or else may "fail".
\par \pard \tx284
\par \pard \tx284     The possible return values are:
\par
\par \trowd \trgaph108\trleft-108 \cellx5670\cellx11448 \pard \li284\intbl\tx284 GPR_FAIL\cell \pard \intbl\tx284 Text matches nothing.\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx5670\cellx11448 \pard \li284\intbl\tx284 GPR_REPARSE\cell \pard
\intbl\tx284 I've actually rewritten the text, so you'll have to start parsing it again from the beginning.\cell \pard \intbl \row \pard \li284\intbl\tx284 GPR_NUMBER\cell \pard \intbl\tx284 Text matches a number (which should be put in the variabl
e "parsed_number").\cell \pard \intbl \row \pard \li284\intbl\tx284 GPR_PREPOSITION\cell \pard \intbl\tx284 Text is understood, so carry on parsing the line, but it doesn't result in a number or an object.\cell \pard \intbl \row \pard \li284\intbl\tx284
GPR_NOUN\cell \pard \intbl\tx284 Parse from where I've left "wn" as though the token were "noun".\cell \pard \intbl \row \pard \li284\intbl\tx284 GPR_HELD\cell \pard \intbl\tx284 Ditto for "held"...\cell \pard \intbl \row \pard \li284\intbl\tx284
GPR_MULTI\cell \pard \intbl\tx284 and so on...\cell \pard \intbl \row \pard \li284\intbl\tx284 GPR_MULTIHELD\cell \pard \intbl\tx284 \cell \pard \intbl \row \pard \li284\intbl\tx284 GPR_MULTIEXCEPT\cell \pard \intbl\tx284 \cell \pard \intbl \row \pard
\li284\intbl\tx284 GPR_MULTIINSIDE\cell \pard \intbl\tx284 \cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx5670\cellx11448 \pard \li284\intbl\tx284 GPR_CREATURE\cell \pard \intbl\tx284 \cell \pard \intbl \row \pard \tx284
\par \pard \li284\tx284 To demonstrate this, here is an imaginary feature of English.  Suppose that the English language has a verb called "glob" whose object must be in the dative.  For instance,
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     glob to the duck
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 is grammatical but
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     glob duck
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 isn't (because "duck" on its own is an accusative noun).  We can set up the
\par verb as follows:
\par
\par     Verb "glob" * dativenoun -> Glob;
\par
\par \pard \li284\tx284 and here is a simple version of "dativenoun":
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     [ dativenoun w;
\par \pard \s16       w = NextWord();
\par       if (w == 'to') return GPR_NOUN;
\par       return GPR_FAIL;
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 (read this as: if the next word is "to", try and match a noun following it; otherwise the sentence isn't grammatical).  Now suppose further that English is inflected aft
er all.  We shall pretend that for most nouns, one simply suffixes "ot" to the end.  But a few nouns are irregular: the dative of "gull" is by some historical accident "gullit", not "gullot".  Now we have to make "dativenoun" cope with the following possi
bilities:
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx2268\cellx11448 \pard \li284\intbl\tx284 glob duck\cell \pard \intbl\tx284 incorrect\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2268\cellx11448 \pard \li284\intbl\tx284 glob to the duck\cell \pard
\intbl\tx284 correct\cell \pard \intbl \row \pard \li284\intbl\tx284 glob the duckot\cell \pard \intbl\tx284 correct\cell \pard \intbl \row \pard \li284\intbl\tx284 glob duckot\cell \pard \intbl\tx284 correct\cell \pard \intbl \row \pard
\li284\intbl\tx284 glob to gull\cell \pard \intbl\tx284 correct\cell \pard \intbl \row \pard \li284\intbl\tx284 glob gullot\cell \pard \intbl\tx284 incorrect\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2268\cellx11448 \pard
\li284\intbl\tx284 glob gullit\cell \pard \intbl\tx284 correct\cell \pard \intbl \row \pard \tx284
\par \pard \li284\tx284 Here is a second try.  Suppose we create our duck and gull objects by:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Object -> "duck"
\par \pard \s16       with name 'duck',
\par            dativename 'duckot';
\par     Object -> "gull"
\par       with name 'gull',
\par            dativename 'gullit';
\par
\par     [ dativenoun w;
\par       w = NextWord();
\par       if (w == 'to') return GPR_NOUN;
\par       wn--;
\par       parser_inflection = dativename;
\par       return GPR_NOUN;
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
"parser_inflection" is a variable used in the parser to know the case of what's being parsed.  It must always be equal to _either_ a property, _or_ a routine.  Most of the time it's equal to the property "name"
, which just means "accusative case as normal".  If it equals another property, such as "dativename", then the parser looks in that property for name-words instead of in "name".
\par \pard \tx284
\par \pard \li284\tx284
This now does what was asked.  But it's really an annoying burden on the game designer to expect him to give dative forms of every name, particularly if for almost every name the dative is formed by suffixing "ot".  It's for this that "parser_inflection"
can be set to a routine name.  So here is yet a third form:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Object -> "duck"
\par \pard \s16       with name 'duck' 'bird' 'mallard';
\par     Object -> "gull"
\par       with name 'gull' 'bird',
\par            dativename 'gullit';
\par
\par     [ dative obj word a l;
\par       a = WordAddress(wn-1);
\par       l = WordLength(wn-1);
\par
\par       if (l >= 3 && a->(l-2)=='o' or 'O' && a->(l-1)=='t' or 'T')
\par       \{   word = DictionaryLookup(a, l-2);
\par           return WordInProperty(word, obj, name);
\par       \}
\par
\par       if (obj provides dativename)
\par           return WordInProperty(word, obj, dativename);
\par       rfalse;
\par     ];
\par
\par     [ dativenoun w;
\par       w = NextWord();
\par       if (w == 'to') return GPR_NOUN;
\par       wn--;
\par       parser_inflection = dative;
\par       return GPR_NOUN;
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284
An inflection routine, like "dative", is called with two arguments, an object and a dictionary word.  It has to reply true or false -- true if the dictionary word can mean the object, false if not.  "wn" is always set to the number of the next word along
(and it should not be moved).
\par \pard \tx284
\par \pard \li284\tx284 What happens in "dative" is that two standard library routines are used to find the a
ctual text of the word being looked at.  (This will be exactly in the form the player typed -- which is convenient if the word is very long and contains a vital suffix.)  After the statements
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057       a = WordAddress(wn-1);
\par \pard \s16       l = WordLength(wn-1);
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 then the word being argued over is held in the array
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057       a->0, a->1, ..., a->(l-1)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 so we might for instance have l=6 and
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057       a->0 = 'd'
\par \pard \s16       a->1 = 'u'
\par       a->2 = 'c'
\par       a->3 = 'k'
\par       a->4 = 'o'
\par       a->5 = 't'
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 The "dative" routine looks to see if the last two letters are OT, as in this case they are.  It then uses two more library routines.
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     DictionaryLookup(text, length)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 returns 0 if the word at "text" and of the given length is not in the game's dictionary, or its dictionary entry if it is.  In this case, the call
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     DictionaryLookup(a, 4)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 tests whether "duck" is in the dictionary, and it is, so the variable "word" becomes the dictionary entry 'duck'.  And "dative" finally uses another library routine,
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     WordInProperty(word, object, property)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 to see if this is one of the words listed in object.property.
\par \pard \tx284
\par \pard \li284\tx284
If on the other hand the word had not ended in OT -- if it were "gullit", for instance -- then the "dative" routine would have tried to look it up in the object's "dativename" property.  Finally, then, the designer only has to give names in the dativename
property if they are irregular.  The dative forms
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     birdot, duckot, mallardot
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 are recognised automatically.  ("gullot" is also detected, though it's wrong.  But Inform's parser always takes the view that it's better to understand too much than too little.)
\par \pard \tx284
\par \pard \li284\tx284 One more surreal invention.  Let us suppose English has the pronominal adverb "toit", meaning "to it", which can be used as a dative.  The easiest way to arrange this is to elaborate "dativenoun" again:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     [ dativenoun w;
\par \pard \s16       w = NextWord();
\par       if (w == 'to') return GPR_NOUN;
\par       if (w == 'toit')
\par       \{   w = PronounValue('it');
\par           if (w == NULL) return GPR_FAIL;
\par           if (TestScope(w, actor)) return w;
\par           return GPR_FAIL;
\par       \}
\par       wn--;
\par       parser_inflection = dative;
\par       return GPR_NOUN;
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284
Note that it isn't safe to always allow "it" to be referred to -- "it" might be an object in another room and now out of scope.  Or it might still be unset.  (In the case of 'it', this is unlikely.  But a pronoun meaning "a group of two or more women" mig
ht well remain unset throughout a game.)
\par \pard \tx284
\par \pard \li284\tx284 Tokens like "dativenoun" are best defined in the grammar file, not the language definition file.  (It doesn't really matter, but it's better form.)
\par \pard \tx284
\par \pard \li284\tx284 Similar means can be used for languages, such as German or Swedish, in which nouns or adjectives agree with the article (definite or indefinite) applied to them.  For example,
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284 {\ul English\cell }\pard \intbl\tx284 {\ul Swedish\cell }\pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284 a brown dog\cell
\pard\plain \s20\intbl \i\f4\lang2057 en brun hund\cell \pard\plain \intbl \f4\lang2057 \row \pard \li284\intbl\tx284 the brown dog\cell \pard\plain \s20\intbl \i\f4\lang2057 den bruna hunden\cell \pard\plain \intbl \f4\lang2057 \row \pard
\li284\intbl\tx284 a brown house\cell \pard\plain \s20\intbl \i\f4\lang2057 ett brunt hus\cell \pard\plain \intbl \f4\lang2057 \row \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284 the brown house\cell \pard\plain \s20\intbl
\i\f4\lang2057 det bruna huset\cell \pard\plain \intbl \f4\lang2057 \row \pard \tx284
\par \pard \li284\tx284 The simplest solution would be to make the designer always allow all forms, e.g.,
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Object ->
\par \pard \s16       with name 'brun' 'bruna' 'hund' 'hunden';
\par     Object ->
\par       with name 'brunt' 'bruna' 'hus' 'huset';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 But if it's felt that this is an unreasonable burden to place on the game designer, a parser_inflection routine could be designed to handle it. It may be useful to know that the variable
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     indef_mode
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 is always set to "true" when parsing something known to be indefinite (e.g. because an indefinite article has just been typed), and "false" otherwise.
\par \pard \tx284
\par \pard \li284\tx284 Finally, note that the above methods are only one way of dealing with case suffixes and pronominal adverbs.  You could instead handle these at the "translating to Informese" stage, by writing code that translates
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     glob duckot                -->     glob to duck
\par \pard \s16     glob toit                  -->     glob to it
\par     den bruna hunden           -->     den brun hund
\par     det bruna huset            -->     det brun hus
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 before parsing gets underway.  In a heavily inflected language with many irregularities, a combination of the two techniques may be needed.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.0}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.0  Organisation of language definition files}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:29990}} L.0  Organisation of language definition files
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 A language definition file is itself written in Inform.  (When reading this and the other L.* sections, it may be useful to have a copy of English.h (the English LDF) to refer to.)  Such a file is divided into four parts:
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx1276\cellx11448 \pard \li284\intbl\tx284 Part I.\cell \pard \intbl\tx284 Preliminaries\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1276\cellx11448 \pard \li284\intbl\tx284 Part II.\cell \pard \intbl\tx284
Vocabulary\cell \pard \intbl \row \pard \li284\intbl\tx284 Part III.\cell \pard \intbl\tx284 Translating to Informese\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1276\cellx11448 \pard \li284\intbl\tx284 Part IV.\cell \pard \intbl\tx284
Printing\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 It would be very helpful if all LDFs could follow the order and layout style of "English.h", and in particular follow this division into four parts.
\par \pard \tx284
\par \pard \tx284 The example of French will be developed throughout, with diversions to other languages when this would be more interesting.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.1.1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} L.I.1  Version number and alphabet}}
{\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299911}} L.I.1  Version number and alphabet
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 The file should begin as follows:
\par
\par \pard\plain \s16 \f3\lang2057     ! =======================================================================
\par \pard \s16     !   Inform Library Definition File: French
\par     !
\par     !   (c) Graham Nelson 1996
\par     ! -----------------------------------------------------------------------
\par     System_file;
\par     ! -----------------------------------------------------------------------
\par     !   Part I.   Preliminaries
\par     ! -----------------------------------------------------------------------
\par     Constant LanguageVersion
\par             = "Traduction fran@ccais 961205 par Graham Nelson";
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 [The English LDF defines a constant called EnglishNaturalLanguage here, but this is just to help the library keep old code working with the new parser: don't define a similar constant yourself.]
\par \pard \tx284
\par \pard \tx284 The next ingredient of Part I is declaring the accented letters which are "important" (see 2.4 above).  Up to about 10 can
be so given.  The most important should be given first; if more than 10 are given, then it's possible that those towards the bottom of the list may not find room for themselves in the list of "cheap" letters.  The declarations should use the "Zcharacter"
directive (see the Inform Technical Manual if you're curious about this).  For example:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Zcharacter '@'e';         ! E-acute
\par \pard \s16     Zcharacter '@`e';         ! E-grave
\par     Zcharacter '@`a';         ! A-grave
\par     Zcharacter '@`u';         ! U-grave
\par     Zcharacter '@^a';         ! A-circumflex
\par     Zcharacter '@^e';         ! E-circumflex
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
(Note that since the Z-machine automatically reduces anything the player types into lower case, we need only include lower-case accented letters here.  Note also that there are plenty of other French accented letters -- I-umlaut, U-circumflex, etc. -- but
the others are quite uncommon.)
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.1.2}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} L.I.2}} {\cs21\super +{\footnote
\pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299912}} L.I.2   Compass objects
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 All that is left in Part I is to declare standard compass directions.  The corresponding part of "English.h" reads:
\par
\par \pard\plain \s16 \f3\lang2057     Class  CompassDirection
\par \pard \s16       with article "the", number 0
\par       has  scenery;
\par     Object Compass "compass" has concealed;
\par     IFNDEF WITHOUT_DIRECTIONS;
\par     CompassDirection -> n_obj "north wall"
\par                         with name 'n' 'north' 'wall',      door_dir n_to;
\par     CompassDirection -> s_obj "south wall"
\par                         with name 's' 'south' 'wall',      door_dir s_to;
\par     CompassDirection -> e_obj "east wall"
\par                         with name 'e' 'east' 'wall',       door_dir e_to;
\par     CompassDirection -> w_obj "west wall"
\par                         with name 'w' 'west' 'wall',       door_dir w_to;
\par     CompassDirection -> ne_obj "northeast wall"
\par                         with name 'ne' 'northeast' 'wall', door_dir ne_to;
\par     CompassDirection -> nw_obj "northwest wall"
\par                         with name 'nw' 'northwest' 'wall', door_dir nw_to;
\par     CompassDirection -> se_obj "southeast wall"
\par                         with name 'se' 'southeast' 'wall', door_dir se_to;
\par     CompassDirection -> sw_obj "southwest wall"
\par                         with name 'sw' 'southwest' 'wall', door_dir sw_to;
\par     CompassDirection -> u_obj "ceiling"
\par                         with name 'u' 'up' 'ceiling',      door_dir u_to;
\par     CompassDirection -> d_obj "floor"
\par                         with name 'd' 'down' 'floor',      door_dir d_to;
\par     ENDIF;
\par     CompassDirection -> out_obj "outside"
\par                         with                               door_dir out_to;
\par     CompassDirection -> in_obj "inside"
\par                         with                               door_dir in_to;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 and this should be copied as nearly as possible, with the dictionary words (in single quotes above) translated.  For example, "French.h" has:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Class  CompassDirection
\par \pard \s16       with article "le", number 0
\par       has  scenery;
\par     Object Compass "compas" has concealed;
\par     IFNDEF WITHOUT_DIRECTIONS;
\par     CompassDirection -> n_obj "mur nord"
\par                         with name 'n' 'nord' 'mur',        door_dir n_to;
\par     CompassDirection -> s_obj "mur sud"
\par                         with name 's' 'south' 'mur',       door_dir s_to;
\par     CompassDirection -> e_obj "mur est"
\par                         with name 'e' 'east' 'mur',        door_dir e_to;
\par     CompassDirection -> w_obj "mur ouest"
\par                         with name 'o' 'ouest' 'mur',       door_dir w_to;
\par     CompassDirection -> ne_obj "mur nord-est"
\par                         with name 'ne' 'nordest' 'mur',    door_dir ne_to;
\par     CompassDirection -> nw_obj "mur nord-ouest"
\par                         with name 'no' 'nordouest' 'mur',  door_dir nw_to;
\par     CompassDirection -> se_obj "mur sud-est"
\par                         with name 'se' 'sudest' 'mur',     door_dir se_to;
\par     CompassDirection -> sw_obj "mur sud-ouest"
\par                         with name 'so' 'sudouest' 'mur',   door_dir sw_to;
\par     CompassDirection -> u_obj "plafond"
\par                         with name 'h' 'haut' 'plafond',    door_dir u_to;
\par     CompassDirection -> d_obj "planch@'e"
\par                         with name 'b' 'bas' 'planche',     door_dir d_to;
\par     ENDIF;
\par     CompassDirection -> out_obj "l'ext@'erieure"
\par                         with                               door_dir out_to
\par                         has proper;
\par     CompassDirection -> in_obj "l'int@'erieure"
\par                         with                               door_dir in_to
\par                         has proper;
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.2.1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.II.1  Informese vocabulary: miscellaneous}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299921}} L.II.1  Informese vocabulary: miscellaneous
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Part II begins with dictionary words for various simple parts of speech.  For instance, we are required to give three synonymous ways to write "again" (the command meaning "repeat the previous command").  In French, this might be:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Constant AGAIN1__WD   = 'encore';
\par \pard \s16     Constant AGAIN2__WD   = #n$c;
\par     Constant AGAIN3__WD   = 'encore';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (We can't actually think of a third different word.  But we must define AGAIN3__WD all the same, and must not allow it to be 0.)
\par \pard \tx284
\par \pard \tx284 gives three synonymous words for what would be called the "again" command in English: two of these are the same.  (Do not define any as zero: if necessary, duplicate them as
above if you don't need the number provided.)  So in French Inform, "encore" and "c" will both repeat the previous command.
\par \pard \tx284
\par These sets all take the form above.  There are:
\par
\par \trowd \trgaph108\trleft-108 \cellx2127\cellx11448 \pard \intbl\tx284 AGAIN*__WD\cell \pard \intbl\tx284 words meaning the "again" command\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2127\cellx11448 \pard \intbl\tx284 UNDO*__WD\cell \pard
\intbl\tx284 words meaning the "undo" command\cell \pard \intbl \row \pard \intbl\tx284 OOPS*__WD\cell \pard \intbl\tx284 words meaning the "oops" command\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell \pard \intbl \row \pard
\intbl\tx284 THEN*__WD\cell \pard \intbl\tx284 then-words\cell \pard \intbl \row \pard \intbl\tx284 AND*__WD\cell connective: conjunction\cell \pard \intbl \row \pard \intbl\tx284 BUT*__WD\cell \pard \intbl\tx284 connective: disjunction\cell \pard \intbl
\row \pard \intbl\tx284 ALL*__WD\cell \pard \intbl\tx284 all-words\cell \pard \intbl \row \pard \intbl\tx284 OTHER*__WD\cell \pard \intbl\tx284 other-words\cell \pard \intbl \row \pard \intbl\tx284 ME*__WD\cell \pard \intbl\tx284 me-words\cell \pard
\intbl \row \pard \intbl\tx284 OF*__WD\cell \pard \intbl\tx284 words like "of" used in the sense of "three of the boxes" when parsing a reference to a given number of things\cell \pard \intbl \row \pard \intbl\tx284 \cell \pard \intbl\tx284 \cell \pard
\intbl \row \pard \intbl\tx284 YES*__WD\cell \pard \intbl\tx284 words meaning "yes" when answering "yes or no" questions\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2127\cellx11448 \pard \intbl\tx284 NO*__WD\cell \pard \intbl\tx284
words meaning "no" when answering "yes or no" questions\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 In each case * runs from 1 to 3, except for ALL where it runs 1 to 5 and OF where it runs from 1 to 4.
\par
\par \pard \tx284 Note that French provides the single-letter word "o" as an answer to yes-no questions (oui-non questions in French), which doesn't clash with the direction abbreviation "o" for "{\i ouest}" since these yes
-no words are used only to parse answers to direct questions, not in general parsing.  So we could have
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Constant YES1__WD     = #n$o;
\par \pard \s16     Constant YES2__WD     = 'oui';
\par     Constant YES3__WD     = 'oui';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (Likewise "n" for "non", even though "n" is also "nord" in more general play.)
\par
\par \pard \tx284 After the above, a few words have to be defined as possible replies to the question asked when the game ends.  Here the French example is:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Constant AMUSING__WD  = 'amusant';
\par \pard \s16     Constant FULLSCORE1__WD = 'grandscore';
\par     Constant FULLSCORE2__WD = 'grand';
\par     Constant QUIT1__WD    = #n$a;
\par     Constant QUIT2__WD    = 'arret';
\par     Constant RESTART__WD  = 'restart';
\par     Constant RESTORE__WD  = 'restore';
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.2.2}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.II.2  Informese vocabulary: pronouns}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299922}} L.II.2  Informese vocabulary: pronouns
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Part II continues with a table of pronouns, and this is perhaps best explained by example.  Here is the table from "English.h":
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Array LanguagePronouns table
\par \pard \s16
\par       !  word       possible GNAs                   connected
\par       !             to follow:                      to:
\par       !             a     i
\par       !             s  p  s  p
\par       !             mfnmfnmfnmfn
\par
\par          'it'     $$001000111000                    NULL
\par          'him'    $$100000000000                    NULL
\par          'her'    $$010000000000                    NULL
\par          'them'   $$000111000111                    NULL;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 The "connected to" column should always be created with NULL entries.  The pattern of 1s and 0s in the middle column indicates which types of name might be refer
red to with the given pronoun.  For instance, "it" might refer to any singular noun which is not the name of a man, woman or higher animal.  (In the table, I've said that "it" also covers inanimate singular male and female GNAs -- actually these GNAs shou
ld never arise in English anyway.)  Whereas "her" can only stand for a single female name.
\par \pard \tx284
\par \pard \tx284 English has an unusually simple pronoun structure, because accusative and dative pronouns are identical.  French is richer, in that one set of pronouns are used to stand for direct objects:
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard\plain \s20\li284\intbl\tx284 \i\f4\lang2057 donne-le-lui\cell \pard\plain \intbl\tx284 \f4\lang2057 give it to him/her\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 and another, different set are "disjunctive" pronouns (disjunctive meaning in this context that they stand apart from the verb, and are not hyphenated to it):
\par \pard \tx284
\par \pard\plain \s20\li284\intbl\tx284 \i\f4\lang2057 mange avec lui\cell \pard\plain \intbl\tx284 \f4\lang2057 eat with him\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 And here goes:
\par
\par \pard\plain \s16 \f3\lang2057     Array LanguagePronouns table
\par \pard \s16
\par       !  word       possible GNAs                   connected
\par       !             to follow:                      to:
\par       !             a     i
\par       !             s  p  s  p
\par       !             mfnmfnmfnmfn
\par
\par          !   Object pronouns
\par
\par          '-le'    $$100000100000                    NULL
\par          '-la'    $$010000010000                    NULL
\par          '-les'   $$000110000110                    NULL
\par          '-lui'   $$110000110000                    NULL
\par          '-leur'  $$000110000110                    NULL
\par
\par          !   Disjunctive pronouns
\par
\par          'lui'    $$100000100000                    NULL
\par          'elle'   $$010000010000                    NULL
\par          'eux'    $$000100000100                    NULL
\par          'elles'  $$000010000010                    NULL;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 [As we shall see in L.III.1, the hyphenation leaves us some work to do when translating the player's input into Informese -- we want hyphenated words to be split up in order for the above to work.]
\par \pard \tx284
\par \pard \tx284 Using the "pronouns" verb in a game will print out current values, which may be useful when debugging the above table.
\par \pard \tx284
\par A game can find the current value of a pronoun by calling, e.g.,
\par
\par \pard\plain \s16 \f3\lang2057    PronounValue('him')
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 which returns either NULL (if "him" is unset) or the object number it refers to.  More usefully, a game can announce that an object has been mentioned by calling
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    PronounNotice(object)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
For instance, if a magic lantern should suddenly appear, the piece of code making it appear should call PronounNotice(magic_lantern).  The parser will then make 'it' (or whatever pronouns apply) refer to the lantern.  This replaces the old way of doing th
ings, which was to set the variable
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    itobj = magic_lantern
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (itobj, himobj and herobj are still supported in the English version of the parser only, to make sure old code still works).
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.2.3}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.II.3  Informese vocabulary: descriptors}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299923}} L.II.3  Informese vocabulary: descriptors
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Part II continues with a table of descriptors, in a similar format.
\par
\par \pard\plain \s16 \f3\lang2057     Array LanguageDescriptors table
\par \pard \s16
\par       !  word       possible GNAs   descriptor      connected
\par       !             to follow:      type:           to:
\par       !             a     i
\par       !             s  p  s  p
\par       !             mfnmfnmfnmfn
\par
\par          'my'     $$111111111111    POSSESS_PK      0
\par          'this'   $$111000111000    POSSESS_PK      0
\par          'these'  $$000111000111    POSSESS_PK      0
\par          'his'    $$111111111111    POSSESS_PK      'him'
\par          'her'    $$111111111111    POSSESS_PK      'her'
\par          'their'  $$111111111111    POSSESS_PK      'them'
\par          'its'    $$111111111111    POSSESS_PK      'it'
\par          'the'    $$111111111111    DEFART_PK       NULL
\par          #n$a     $$111000111000    INDEFART_PK     NULL
\par          'an'     $$111000111000    INDEFART_PK     NULL
\par          'some'   $$000111000111    INDEFART_PK     NULL;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 This gives three of the four types of descriptor:
\par
\par \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284 POSSESS_PK\cell \pard \intbl\tx284
A possessive adjective, connected either to 0 (meaning to the player object) or to the object referred to by the given pronoun -- which must be one of those in the pronoun table.\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1985\cellx11448
\pard \intbl\tx284 DEFART_PK\cell \pard \intbl\tx284 A definite article.  The connected-to value should be NULL.\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \intbl\tx284 INDEFART_PK\cell \pard \intbl\tx284
An indefinite article.  The connected-to value should be NULL.\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 The fourth kind allows extra desc
riptors to be added which force the objects that follow to have (or not to have) a given attribute.  For example, the following three lines would implement "lit", "lighted" and "unlit" as adjectives automatically understood by the English parser:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057          'lit'    $$111111111111    light           NULL
\par \pard \s16         'lighted' $$111111111111    light           NULL
\par          'unlit'  $$111111111111    (-light)        NULL
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 An attribute name means "must have this attribute"; the negation of it means "must not have this attribute".
\par
\par \pard \tx284 To continue the example, "French.h" has descriptors table:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Array LanguageDescriptors table
\par \pard \s16
\par       !  word       possible GNAs   descriptor      connected
\par       !             to follow:      type:           to:
\par       !             a     i
\par       !             s  p  s  p
\par       !             mfnmfnmfnmfn
\par
\par          'le'     $$100000100000    DEFART_PK       NULL
\par          'la'     $$010000010000    DEFART_PK       NULL
\par          'l^'     $$110000110000    DEFART_PK       NULL
\par          'les'    $$000110000110    DEFART_PK       NULL
\par          'un'     $$100000100000    INDEFART_PK     NULL
\par          'une'    $$010000010000    INDEFART_PK     NULL
\par          'des'    $$000110000110    INDEFART_PK     NULL
\par
\par          'mon'    $$100000100000    POSSESS_PK      0
\par          'ma'     $$010000010000    POSSESS_PK      0
\par          'mes'    $$000110000110    POSSESS_PK      0
\par          'son'    $$100000100000    POSSESS_PK      '-lui'
\par          'sa'     $$010000010000    POSSESS_PK      '-lui'
\par          'ses'    $$000110000110    POSSESS_PK      '-lui'
\par          'leur'   $$110000110000    POSSESS_PK      '-les'
\par          'leurs'  $$000110000110    POSSESS_PK      '-les';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (recall that in dictionary words, the apostrophe is written ^, so that 'l^' means "l'").  Thus, "{\i son oiseau}" means "his bird" or "her bird" according to what "-lui" would currently mean (i.e., the most recent singular noun referred to).

\par \pard \tx284
\par \pard \tx284 Note that in the French tables, the ambiguity of (say) "{\i leur}" (does it mean the possessive ad
jective for the last plural mentioned, or does it mean the plural direct object pronoun?) is resolved by the hyphen trick: we're distinguishing between "-leur" (direct object pronoun) and "leur" (possessive adjective), just as we distinguished between "-l
ui" (direct object pronoun) and "lui" (disjunctive pronoun).
\par \pard \tx284
\par \pard \tx284 It is not always so easy.  In English, "her" can mean either the possessive adjective for a feminine singular, or the object pronoun for a feminine singular, so that it occurs in both pronoun and
descriptor tables.  The Inform parser notices this automatically and tries out both meanings when parsing.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.2.4}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.II.4  Informese vocabulary: numbers}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299924}} L.II.4  Informese vocabulary: numbers
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 An array should be given of dictionary words for the first 20 numbers, e.g.:
\par
\par \pard\plain \s16 \f3\lang2057     Array LanguageNumbers table
\par \pard \s16         'un' 1 'une' 1 'deux' 2 'trois' 3 'quatre' 4 'cinq' 5
\par         'six' 6 'sept' 7 'huit' 8 'neuf' 9 'dix' 10
\par         'onze' 11 'douze' 12 'treize' 13 'quatorze' 14 'quinze' 15
\par         'seize' 16 'dix-sept' 17 'dix-huit' 18 'dix-neuf' 19 'vingt' 20;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 [In some languages, like Russian, there are numbers larger than 1 which inflect with gender: please recognise all possibilities here.]
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.3.1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.III.1  Translating natural language to Informese}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:299931}} L.III.1  Translating natural language to Informese
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
Part III is potentially the trickiest part of a language definition file to write: it holds the routine to convert what the player has typed into Informese.  This is optional, but for most languages something will have to be done.  For instance:
\par \pard \tx284
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}Break up words at hyphens and apostrophes. (The Z-machine doesn't automatically do this.)  Thus
\par \pard \tx284
\par \pard \tx284          {\i donne-lui l'oiseau } (French: "give him the bird")
\par
\par \pard \li284\tx284 is transformed into
\par \pard \tx284
\par \pard\plain \s20 \i\f4\lang2057          donne -lui l' oiseau
\par {\pntext\pard\plain\f1 \'b7\tab}\pard\plain \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\f4\lang2057
Remove inflections which don't carry useful information.  For instance, most German imperatives can take two forms, one with an "e" on the end:
\par \pard \tx284
\par \pard \tx284          {\i leg} = {\i lege} (German: "put")    {\i schau} = {\i schaue} (German: "look")
\par
\par \pard \li284\tx284 It would be helpful to remove the "e", which would avoid stuffing game dictionaries full of essentially duplicate entries.
\par \pard \tx284
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}Break affixes away from the words they're glued to.  For instance,
\par \pard \tx284
\par \pard \tx284          {\i cogela} (Spanish: "take it")
\par
\par \pard \li284\tx284 transformed into
\par \pard \tx284
\par \pard\plain \s20 \i\f4\lang2057          coge la
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 so that the affix part "{\i la}" becomes a separate word and can be treated as a pronoun.
\par \pard \tx284
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
Rewrite words which contain more than one kind of Informese grammar.  This one way (though not the only way) to handle pronominal adverbs.
\par \pard \li284\tx284 For instance (French):
\par \pard \tx284
\par \pard\plain \s20 \i\f4\lang2057          dessus   -->   sur lui
\par \pard \s20          dedans   -->   dans lui
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 German has a systematic rule for such words:
\par \pard \tx284
\par \pard\plain \s20 \i\f4\lang2057          davon    -->   von es
\par \pard \s20          darauf   -->   auf es
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284  (Any German preposition can have "{\i da}" or "{\i dar}" applied this way.)  This clearly has to be done with some care.  We wouldn't want to transform
\par \pard \tx284
\par \pard\plain \s20 \i\f4\lang2057          Darren   -->   rren es
\par \pard\plain \tx284 \f4\lang2057
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
Alter word order.  For instance, if the verb occurs at the end of an imperative verb phrase, move it to the start.  Or consider Norwegian, in which (although the indefinite article is straightforward) the definite article is suffixed to nouns:
\par \pard \tx284
\par \pard \tx284          {\i kakane} (Norwegian: "the cakes")  -->  {\i ne kake}
\par
\par \pard \tx284
Part III of the language definition file, then, must consist of one routine, called "LanguageToInformese" (and may also contain any other routines or arrays you need to get this routine working).  Informese being modelled on English, and English being sim
ple anyway, the "English.h" just has:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     [ LanguageToInformese;
\par \pard \s16     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 To write something more substantial you need to know how the Inform parser stores text.  When the call to LanguageToInformese is made, the text that the player typed is held in a -
> array called "buffer", and some useful information about it is held in another array called "parse".
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx1701\cellx11448 \pard\plain \s16\li284\intbl\tx284 \f3\lang2057 buffer->0\cell \pard\plain \intbl\tx284 \f4\lang2057 is the maximum number of characters ever allowed\cell \pard \intbl \row \trowd \trgaph108\trleft-108
\cellx1701\cellx11448 \pard\plain \s16\li284\intbl\tx284 \f3\lang2057 buffer->1\cell \pard\plain \intbl\tx284 \f4\lang2057 is the number actually typed\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1701\cellx11448 \pard\plain
\s16\li284\intbl\tx284 \f3\lang2057 buffer->2\cell \pard\plain \intbl\tx284 \f4\lang2057 ...and subsequent entries... contain the characters.\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 For instance, the contents might look something like this:
\par
\par \pard\plain \s16 \f3\lang2057    buffer-> 0   1   2   3   4   5   6   7   8   9  10  11  ...
\par \pard \s16             80  8   t   a   k   e       a   l   l  ...........
\par \pard\plain \tx284 \f4\lang2057
\par The useful information in "parse" is as follows:
\par \pard \tx284
\par \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284 parse->0\cell \pard \intbl\tx284 is the maximum number of words ever allowed\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284
parse->1\cell \pard \intbl\tx284 is the number actually typed\cell \pard \intbl \row \pard \li284\intbl\tx284 \cell \pard \intbl\tx284 \cell \pard \intbl \row \pard \li284\intbl\tx284 parse-->(x*2+1)\cell \pard \intbl\tx284
is the dictionary entry for word x (counting from 0), or 0 if it's not in the game's dictionary\cell \pard \intbl \row \pard \li284\intbl\tx284 \cell \pard \intbl\tx284 \cell \pard \intbl \row \pard \li284\intbl\tx284 parse->(x*4+4)\cell \pard
\intbl\tx284 is the number of characters of text word x takes up\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1985\cellx11448 \pard \li284\intbl\tx284 parse->(x*4+5)\cell \pard \intbl\tx284
is the position of the first character of word x in the buffer.\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 For instance, the contents might look like this:
\par
\par \pard\plain \s16 \f3\lang2057    parse->  0   1          4   5        8   9   ...............
\par \pard \s16    parse-->         1              3            ...............
\par
\par             20  2          4   2        3   7   ...............
\par                     'take'         'all'        ...............
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
The translation process has to be done by shifting characters about and altering them in "buffer".  Of course, the moment anything in "buffer" is changed, the information in "parse" becomes out of date.  But you can bring it back up to date with the (Info
rm assembly-language) statement
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     @tokenise buffer parse;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (Indeed, the parser does just this when the LanguageToInformese routine has finished.)
\par
\par
\par {\b (a) First example: French hyphens and apostrophes}
\par \pard \tx284
\par \pard \tx284 Here is the translation required to handle French hyphens and apostrophes as in the description above:
\par
\par \pard\plain \s16 \f3\lang2057     [ LanguageToInformese x;
\par \pard \s16
\par       !   Insert a space before each hyphen and after each apostrophe.
\par
\par       for (x=2:x<2+buffer->1:x++)
\par       \{   if (buffer->x == '-') LTI_Insert(x++, ' ');
\par           if (buffer->x == ''') LTI_Insert(x+1, ' ');
\par       \}
\par
\par       !   This code would print out the modified text, for testing purposes,
\par       !   if it were not commented out:
\par       !
\par       !   print "[";
\par       !   for (x=2:x<2+buffer->1:x++)
\par       !       print (char) buffer->x;
\par       !   print "]^";
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Note that
\par
\par \pard\plain \s16 \f3\lang2057       for (x=2:x<2+buffer->1:x++)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 loops through the characters of text in the buffer, and LTI_Insert is a library routine provided to help with translations:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     LTI_Insert(position, character)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 inserts the given character at buffer->position, moving all the subsequent characters along by one.  (It's a
utomatically protected from letting the text overflow out of the buffer.)  Deleting characters is usually unnecessary: you can simply over-write them with spaces.
\par \pard \tx284
\par
\par {\b (b) Second example: French words "dessus" and "dedans"}
\par
\par Here is code to replace any usage of "{\i dessus}" by "{\i sur lui}" and of "{\i dedans}" by "{\i dans lui}":
\par
\par \pard\plain \s16 \f3\lang2057      for (x=0:x<parse->1:x++)
\par \pard \s16      \{
\par          word = parse-->(x*2 + 1);
\par          at = parse->(x*4 + 5);
\par
\par          if (word == 'dessus')
\par          \{   LTI_Insert(at, ' ');
\par              buffer->at     = 's';
\par              buffer->(at+1) = 'u';
\par              buffer->(at+2) = 'r';
\par              buffer->(at+3) = ' ';
\par              buffer->(at+4) = 'l';
\par              buffer->(at+5) = 'u';
\par              buffer->(at+6) = 'i';
\par              break;
\par          \}
\par          if (word == 'dedans')
\par          \{   LTI_Insert(at, ' ');
\par              LTI_Insert(at, ' ');
\par              buffer->at     = 'd';
\par              buffer->(at+1) = 'a';
\par              buffer->(at+2) = 'n';
\par              buffer->(at+3) = 's';
\par              buffer->(at+4) = ' ';
\par              buffer->(at+5) = 'l';
\par              buffer->(at+6) = 'u';
\par              buffer->(at+7) = 'i';
\par              break;
\par          \}
\par      \}
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Actually, this routine only replaces the first usage of either word in the text, which is good enough.  We could have made it replace absolutely every usage by writing
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057              @tokenise buffer parse;
\par \pard \s16              x = 0; continue;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 instead of
\par
\par \pard\plain \s16 \f3\lang2057              break;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 in the two places where that line occurs.
\par
\par
\par {\b (c) Third example: German "da" + preposition
\par }
\par \pard\plain \s16 \f3\lang2057     [ LanguageToInformese x c word at len;
\par \pard \s16
\par       for (x=0:x<parse->1:x++)
\par       \{
\par          word = parse-->(x*2 + 1);
\par          len = parse->(x*4 + 4);
\par          at = parse->(x*4 + 5);
\par
\par          if (word == 0 && buffer->at == 'd' && buffer->(at+1) == 'a')
\par          \{   c=2; if (buffer->(at+2) == 'r') c=3;
\par              !   Is the rest of the word, after "da" or "dar", in dict?
\par              word = DictionaryLookup(buffer+at+c, len-c);
\par              if (word ~= 0)
\par              \{   buffer->at = ' '; buffer->(at+1) = ' ';
\par                  if (c=3) buffer->(at+2) = ' ';
\par                  LTI_Insert(at+len, 's');
\par                  LTI_Insert(at+len, 'e');
\par                  LTI_Insert(at+len, ' ');
\par                  break;
\par              \}
\par          \}
\par       \}
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 [This routine attacks "{\i da}" or "{\i dar}" plus any valid dictionary word, as long as the whole thing isn't a valid dictionary word already.  That might be a bit extreme -- we could impose further restrictions if we wanted to.]
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_3}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
3  Teaching Inform to write your language}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:3}} 3   Teaching Inform to write your language
\par \pard\plain \tx284 \f4\lang2057
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_3.1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 3.1  The GNA of short names}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:31}} 3.1  The GNA of short names
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 As explained in Section 2.3 above, Inform provides for up to three genders, and you as the translator will have to decide how to use them.  Although internally they are called
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    male
\par \pard \s16    female
\par    neuter
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 you do not need to make "male" correspond to "masculine", and so on.  Here are examples:
\par
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}English: all nouns are neuter except for those of people (and sometimes higher animals), when they follow the gender of the person.

\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}French, Spanish, Italian: nouns are masculine or feminine, but there is no neuter.
\par {\pntext\pard\plain\f1 \'b7\tab}German, Dutch: nouns are masculine, feminine or neuter.
\par {\pntext\pard\plain\f1 \'b7\tab}\pard \fi-283\li283\tx284{\*\pn \pnlvlblt\pnf1\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
Norwegian: here the number of genders is a matter of dialect; an old-fashioned view of Norwegian is that it has two genders, "common" (containing all words from the older masculine and feminine genders) and "neuter": but nowadays Norwegian has absorbed a
new feminine gender from its rural dialects.  So: use the "male" attribute for common gender, the "female" attribute for the dialect feminine and "neuter" for neuter.
\par \pard \tx284
\par \pard \tx284 The Inform library needs to know the GNA of object names so that it can print articles.  For example, to print the room description:
\par \pard \tx284
\par \pard\plain \s20 \i\f4\lang2057     Voli\'e8re
\par \pard \s20     Un jungle superb des b\'eates et des arbres.
\par
\par     On peut voir trois oiseaux (une oie, un moineau et un cygne blanc),
\par     cinq bo\'eetes, un hu\'eetre, Edith Piaf et des raisins ici.
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 the library needs to know that
\par
\par \trowd \trgaph108\trleft-108 \cellx1560\cellx11448 \pard\plain \s20\li284\intbl\tx284 \i\f4\lang2057 oie\cell \pard\plain \intbl\tx284 \f4\lang2057 is female singular\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1560\cellx11448 \pard\plain
\s20\li284\intbl\tx284 \i\f4\lang2057 moineau\cell \pard\plain \intbl\tx284 \f4\lang2057 is male singular\cell \pard \intbl \row \pard\plain \s20\li284\intbl\tx284 \i\f4\lang2057 cygne blanc\cell \pard\plain \intbl\tx284 \f4\lang2057 is male singular
\cell \pard \intbl \row \pard\plain \s20\li284\intbl\tx284 \i\f4\lang2057 hu\'eetre\cell \pard\plain \intbl\tx284 \f4\lang2057 is male singular\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx1560\cellx11448 \pard\plain \s20\li284\intbl\tx284
\i\f4\lang2057 raisins\cell \pard\plain \intbl\tx284 \f4\lang2057 is plural\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 It can only be sure of finding such information if it has the GNA of every object name available.
\par
\par \pard \tx284 A game designer using your translation of the library will have to specify the GNA of every object's name, for printing purposes.  The A part is easy: objects which have the
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     animate
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 attribute have animation, and all other objects haven't.  The N part is similar: any object which has the
\par
\par \pard\plain \s16 \f3\lang2057     pluralname
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 attribute is considered to have a plural name (it's still only one object: an example might be a
n object called "doors" which represented doubled doors, or "grapes" representing a bunch of grapes).  All other objects are considered to have singular short names.
\par \pard \tx284
\par To specify the gender, you can either give an object one of the attributes
\par
\par \pard\plain \s16 \f3\lang2057     male
\par     female
\par \pard \s16     neuter
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 or you can let the Inform library guess.  It guesses using two constants,
\par
\par \trowd \trgaph108\trleft-108 \cellx3119\cellx11448 \pard \li284\intbl\tx284 LanguageAnimateGender\cell \pard \intbl\tx284 default gender for something animate\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx3119\cellx11448 \pard
\li284\intbl\tx284 LanguageInanimateGender\cell \pard \intbl\tx284 default gender for something inanimate\cell \pard \intbl \row \pard \tx284
\par \pard \tx284 which must be defined at the start of Part IV of the language definition file (see L.IV.1).
\par
\par Finally, there might be times when it's useful to know an object's GNA, and for this the routine
\par
\par \pard\plain \s16 \f3\lang2057    GetGNAOfObject(obj)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 returns 0 to 11 according to the table of values given in section 2.3 above.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_3.2}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} 3.2  Flexion in short names}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:32}} 3.2  Flexion in short names
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Short names of objects are likely to vary with case, in inflected languages such as German or Latin.  There is no automatic way Inform can correct the case of short names, though, so it will be up to you to manage this.
You may want to define printing rules:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    [ DativeName;
\par \pard \s16      ...
\par    ];
\par
\par    "You give ", (name) noun, " to ", (DativeName) second;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 It might be necessary to insist that designers always create objects with a property giving dative forms of their short names, perhaps.
\par \pard \tx284
\par \pard \tx284 Inform already does this in the case of short names being inflected according to whether they take the definite or indefinite articles.
\par \pard \tx284 For instance,
\par
\par \trowd \trgaph108\trleft-108 \cellx2127\cellx11448 \pard \intbl\tx284 {\ul English\cell }\pard \intbl\tx284 {\ul Swedish\cell }\pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2127\cellx11448 \pard \intbl\tx284 a brown dog\cell \pard\plain \s20\intbl
\i\f4\lang2057 en brun hund\cell \pard\plain \intbl \f4\lang2057 \row \pard \intbl\tx284 the brown dog\cell \pard\plain \s20\intbl \i\f4\lang2057 den bruna hunden\cell \pard\plain \intbl \f4\lang2057 \row \pard \intbl\tx284 a brown house\cell \pard\plain
\s20\intbl \i\f4\lang2057 ett brunt hus\cell \pard\plain \intbl \f4\lang2057 \row \pard \intbl\tx284 the brown house\cell \pard\plain \s20\intbl \i\f4\lang2057 det bruna huset\cell \pard\plain \intbl \f4\lang2057 \row \pard \intbl\tx284 \cell \pard
\intbl\tx284 \cell \pard \intbl \row \pard \intbl\tx284 {\ul English\cell }\pard \intbl\tx284 {\ul German\cell }\pard \intbl \row \pard \intbl\tx284 the red book\cell \pard\plain \s20\intbl \i\f4\lang2057 das rote Buch\cell \pard\plain \intbl
\f4\lang2057 \row \trowd \trgaph108\trleft-108 \cellx2127\cellx11448 \pard \intbl\tx284 a red book\cell \pard\plain \s20\intbl \i\f4\lang2057 ein rotes Buch\cell \pard\plain \intbl \f4\lang2057 \row \pard \tx284
\par \pard \tx284 When a short name is being printed, the variable
\par
\par \pard\plain \s16 \f3\lang2057     indef_mode
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 is always "true" if an indefinite article has just been printed, and "false" otherwise.  So one way to provide the above would be to define
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Object ->
\par \pard \s16       with short_name
\par            [;  if (indef_mode) print "rotes Buch";
\par                else print "rote Buch";
\par                rtrue;
\par            ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 But this clumsy, so in addition to this, Inform allows you to use the property short_name_indef:
\par
\par \pard\plain \s16 \f3\lang2057     Object ->
\par \pard \s16       with short_name "rote Buch",
\par            short_name_indef "rotes Buch";
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.1}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.IV.1  Default genders and contraction forms}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399941}} L.IV.1  Default genders and contraction forms
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Part IV opens with these two declarations.  For instance, "English.h" has:
\par
\par \pard\plain \s16 \f3\lang2057     Constant LanguageAnimateGender   = male;
\par \pard \s16     Constant LanguageInanimateGender = neuter;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 whereas "French.h" has:
\par
\par \pard\plain \s16 \f3\lang2057     Constant LanguageAnimateGender   = male;
\par \pard \s16     Constant LanguageInanimateGender = male;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Anoth
er piece of jargon: a "contraction form" is a textual feature of a noun which causes any article in front of it to inflect.  English has two contraction forms, "starting with a vowel" and "starting with a consonant", and the indefinite article inflects wi
th it:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     a + orange = an orange
\par \pard \s16     a + banana = a banana
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 This section must first define a constant.  In the case of "French.h":
\par
\par \pard\plain \s16 \f3\lang2057     Constant LanguageContractionForms = 2;        ! French has two:
\par \pard \s16                                                   ! 0 = starting with a const.
\par                                                   ! 1 = starting with a vowel
\par                                                   !     or mute h
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 It's up to you how you number these, but contraction form 0 should be the one which most often happens.
\par
\par \pard \tx284 You also have to provide a routine to decide what contraction form a piece of text has.  Here is an approximate version for French:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    [ LanguageContraction text;
\par \pard \s16      if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u' or 'h'
\par                     or 'A' or 'E' or 'I' or 'O' or 'U' or 'H') return 1;
\par      return 0;
\par    ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
The "text" array holds the full text of the noun, though this routine would normally only look at the first few letters at most.  (Inform only calls this routine when it absolutely needs to know -- for instance, it doesn't bother when printing definite ar
ticles in English, because they don't vary with contraction form.  It detects this automatically from the table below.)
\par \pard \tx284
\par \pard \tx284 The above is only approximate because French has many accented vowels to check, too.  Now a comparison going on and on like
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057                     ... or '@`e' or '@`a' or ...
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 could become very long and tiresome: you might instead want to create an array recording whether each character is a vowel or consonant.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.2}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} L.IV.2  How to print: articles}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399942}} L.IV.2  How to print: articles
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 The Inform library needs to print three kinds of article:
\par
\par \trowd \trgaph108\trleft-108 \cellx2835\cellx4253\cellx5812 \pard \intbl\tx284 \cell \pard \intbl\tx284 English\cell \pard \intbl\tx284 French\cell \pard \intbl \row \trowd \trgaph108\trleft-108 \cellx2835\cellx4253\cellx5812 \pard \intbl\tx284
indefinite articles\cell \pard \intbl\tx284 a, an, some\cell \pard\plain \s20\intbl \i\f4\lang2057 un, une, des\cell \pard\plain \intbl \f4\lang2057 \row \pard \intbl\tx284 definite articles\cell \pard \intbl\tx284 the\cell \pard\plain \s20\intbl
\i\f4\lang2057 le, la, l', les\cell \pard\plain \intbl \f4\lang2057 \row \trowd \trgaph108\trleft-108 \cellx2835\cellx4253\cellx5812 \pard \intbl\tx284 Capitalised definite articles\cell \pard \intbl\tx284 The\cell \pard\plain \s20\intbl \i\f4\lang2057
Le, La, L', les\cell \pard\plain \intbl \f4\lang2057 \row \pard \tx284
\par \pard \tx284 Articles vary not only with contraction form but with the GNA of the noun they apply to.
\par
\par {\b (a) Example 1: French
\par }
\par \pard\plain \s16 \f3\lang2057     Constant LanguageContractionForms = 2;        ! French has two:
\par \pard \s16                                                   ! 0 = starting with a const.
\par                                                   ! 1 = starting with a vowel
\par                                                   !     or mute h
\par
\par     [ LanguageContraction text;
\par       if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u' or 'h'
\par                      or 'A' or 'E' or 'I' or 'O' or 'U' or 'H') return 1;
\par       return 0;
\par     ];
\par
\par     Array LanguageArticles -->
\par
\par      !   Contraction form 0:     Contraction form 1:
\par      !   Cdef   Def    Indef     Cdef   Def    Indef
\par
\par          "Le "  "le "  "un "     "L'"   "l'"   "un "         ! 0: masc sing
\par          "La "  "la "  "une "    "L'"   "l'"   "une "        ! 1: fem sing
\par          "Les " "les " "des "    "Les " "les " "des ";       ! 2: plural
\par
\par                        !             a           i
\par                        !             s     p     s     p
\par                        !             m f n m f n m f n m f n
\par
\par     Array LanguageGNAsToArticles --> 0 1 0 2 2 2 0 1 0 2 2 2;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Thus the array "LanguageGNAsToArticles" says, for instance, that animate feminine plural nouns take article form 2, i.e., the third line in the LanguageArticles array:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057          "Les " "les " "des "    "Les " "les " "des "
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 This gives CDef, Def and Indef articles for each of contraction forms 0 and 1.
\par
\par Note the spaces after some words in the array and not others: so, "{\i les arbres}" but "{\i l'huitre}", for instance.
\par
\par
\par {\b (b) Example 2: English}
\par
\par \pard\plain \s16 \f3\lang2057     Constant LanguageContractionForms = 2;     ! English has two:
\par \pard \s16                                                ! 0 = starting with a consonant
\par                                                ! 1 = starting with a vowel
\par
\par     [ LanguageContraction text;
\par       if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u'
\par                      or 'A' or 'E' or 'I' or 'O' or 'U') return 1;
\par       return 0;
\par     ];
\par
\par     Array LanguageArticles -->
\par
\par      !   Contraction form 0:     Contraction form 1:
\par      !   Cdef   Def    Indef     Cdef   Def    Indef
\par
\par          "The " "the " "a "      "The " "the " "an "          ! Articles 0
\par          "The " "the " "some "   "The " "the " "some ";       ! Articles 1
\par
\par                        !             a           i
\par                        !             s     p     s     p
\par                        !             m f n m f n m f n m f n
\par
\par     Array LanguageGNAsToArticles --> 0 0 0 1 1 1 0 0 0 1 1 1;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
\par {\b (c) Example 3: Italian
\par }
\par \pard\plain \s16 \f3\lang2057    Constant LanguageContractionForms = 3;        ! 0 = starting with a const
\par \pard \s16                                                  ! 1 = starting with z
\par                                                  !     or s + a consonant
\par                                                  ! 2 = starting with a vowel
\par
\par    [ LanguageContraction text;
\par      if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u'
\par                     or 'A' or 'E' or 'I' or 'O' or 'U') return 2;
\par      if (text->0 == 'z') return 1;
\par      if (text->0 ~= 's') return 0;
\par      if (text->1 == 'a' or 'e' or 'i' or 'o' or 'u'
\par                     or 'A' or 'E' or 'I' or 'O' or 'U') return 1;
\par      return 0;
\par    ];
\par
\par     Array LanguageArticles -->
\par
\par      !   Contraction form 0:     Contraction form 1:     Contraction form 2:
\par      !   Cdef   Def    Indef     Cdef   Def    Indef     Cdef   Def    Indef
\par
\par          "Il "  "il "  "un "     "Lo "  "lo "  "uno "    "L'"   "l'"   "un "
\par          "La "  "la "  "una "    "Lo "  "lo "  "una "    "L'"   "l'"   "un'"
\par
\par          "I "   "i "   "un "     "Gli " "gli " "uno "    "Gli " "gli " "un "
\par          "Le "  "le "  "una "    "Gli " "gli " "una "    "Le "  "le "  "un'";
\par
\par                        !             a           i
\par                        !             s     p     s     p
\par                        !             m f n m f n m f n m f n
\par
\par     Array LanguageGNAsToArticles --> 0 1 0 2 3 0 0 1 0 2 3 0;
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
\par \pard \tx284 To complicate matters further, a few nouns have irregular articles: in French, for
instance, the initial "h" of some words is not considered mute, for historical reasons: thus, "le haricot", not "l'haricot".  For such nouns, the property "articles" is provided:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    articles "Le " "le " "un "
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 would give CDef, Def and Indef for the "haricot", overriding the system above.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.3}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.IV.3  How to print: direction names}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399943}} L.IV.3  How to print: direction names
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Next is a routine called "LanguageDirection" to print names for direction properties.  Imitate the following (from "French.h"):
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     [ LanguageDirection d;
\par \pard \s16       switch(d)
\par       \{   n_to:    print "nord";
\par           s_to:    print "sud";
\par           e_to:    print "est";
\par           w_to:    print "ouest";
\par           ne_to:   print "nordest";
\par           nw_to:   print "nordouest";
\par           se_to:   print "sudest";
\par           sw_to:   print "sudouest";
\par           u_to:    print "haut";
\par           d_to:    print "bas";
\par           in_to:   print "dans";
\par           out_to:  print "dehors";
\par           default: return RunTimeError(9,d);
\par       \}
\par     ];
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.4}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} L.IV.4  How to print: numbers}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399944}} L.IV.4  How to print: numbers
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Next is a routine called "LanguageNumber" which takes a number N and prints it out in textual form.
\par
\par \pard \tx284 N can be anything from -32768 to +32767 and the correct text should be printed in all cases.  This is probably easiest with a recursive algorithm.  Here, for example, is the "French.h" version:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     [ LanguageNumber n f;
\par \pard \s16       if (n==0)    \{ print "z@'ero"; rfalse; \}
\par       if (n<0)     \{ print "moins "; n=-n; \}
\par       if (n>=1000) \{ print (LanguageNumber) n/1000, " mille"; n=n%1000; f=1; \}
\par       if (n>=100)  \{ if (f==1) print ", ";
\par                      print (LanguageNumber) n/100, " cent"; n=n%100; f=1; \}
\par       if (n==0) rfalse;
\par       switch(n)
\par       \{   1:  print "un";
\par           2:  print "deux";
\par           3:  print "trois";
\par           4:  print "quatre";
\par           5:  print "cinq";
\par           6:  print "six";
\par           7:  print "sept";
\par           8:  print "huit";
\par           9:  print "neuf";
\par           10: print "dix";
\par           11: print "onze";
\par           12: print "douze";
\par           13: print "treize";
\par           14: print "quatorze";
\par           15: print "quinze";
\par           16: print "seize";
\par           17: print "dix-sept";
\par           18: print "dix-huit";
\par           19: print "dix-neuf";
\par           20 to 99:
\par               switch(n/10)
\par               \{  2: print "vingt";
\par                     if (n%10 == 1) \{ print " et un"; return; \}
\par                  3: print "trente";
\par                     if (n%10 == 1) \{ print " et un"; return; \}
\par                  4: print "quarante";
\par                     if (n%10 == 1) \{ print " et un"; return; \}
\par                  5: print "cinquante";
\par                     if (n%10 == 1) \{ print " et un"; return; \}
\par                  6: print "soixante";
\par                     if (n%10 == 1) \{ print " et un"; return; \}
\par                  7: print "soixante";
\par                     if (n%10 == 1) \{ print " et onze"; return; \}
\par                     print "-"; LanguageNumber(10 + n%10); return;
\par                  8: if (n%10 == 0) \{ print "quatre vingts"; return; \}
\par                     print "quatre-vingt";
\par                  9: print "quatre-vingt-"; LanguageNumber(10 + n%10); return;
\par               \}
\par               if (n%10 ~= 0)
\par               \{   print "-"; LanguageNumber(n%10);
\par               \}
\par       \}
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 To test this, you may want to run the routine
\par
\par \pard\plain \s16 \f3\lang2057     [ TestNumbers n;
\par \pard \s16       for (n = -1001: n<=1001: n++) print (number) n, "^";
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (if you have the patience), or
\par
\par \pard\plain \s16 \f3\lang2057     [ TestRNumbers n x y;
\par \pard \s16       for (n = 1: n<=100: n++)
\par       \{   x = random(32767);
\par           y = random(2); if (y == 0) y = -1;
\par           print (number) x*y, "^";
\par       \}
\par     ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 (if you haven't).
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.5}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.IV.5  How to print: the time of day}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399945}} L.IV.5  How to print: the time of day
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Next, a routine called LanguageTimeOfDay should appear, to print out the time of day in a suitable (numeric) style.  Here is the French version:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    [ LanguageTimeOfDay hours mins;
\par \pard \s16      print hours/10, hours%10, "h", mins/10, mins%10;
\par    ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 and here the corresponding English version:
\par
\par \pard\plain \s16 \f3\lang2057    [ LanguageTimeOfDay hours mins i;
\par \pard \s16        print (string) TIME__TX;
\par        i=hours%12; if (i<10) print " ";
\par        if (i==0) i=12;
\par        print i, ":", mins/10, mins%10;
\par        if ((hours/12) > 0) print " pm"; else print " am";
\par    ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 so that 23 minutes past 1 in the afternoon would be printed as
\par
\par \pard\plain \s16 \f3\lang2057     13h23         1:23 pm
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 according to national custom.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.6}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} L.IV.6  How to print: verbs}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399946}} L.IV.6  How to print: verbs
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Inform sometimes needs to print verbs out, in messages like:
\par
\par \pard\plain \s16 \f3\lang2057    I only understood you as far as wanting to {\ul take} the red box.    (*)
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 It normally does this by simply printing out the verb's dictionary entry.  However, dictionary entries tend to be cut short (to the first 9 le
tters or so) or else to be abbreviations (like "i" meaning "inventory").  This routine must look at its argument and either print a textual form and return true, or return false (letting the library carry on as normal):
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    [ LanguageVerb i;
\par \pard \s16      if (i==#n$l)        \{ print "look";              rtrue; \}
\par      if (i==#n$z)        \{ print "wait";              rtrue; \}
\par      if (i==#n$x)        \{ print "examine";           rtrue; \}
\par      if (i==#n$i or 'inv' or 'inventory')
\par                          \{ print "inventory";         rtrue; \}
\par      rfalse;
\par    ];
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 It's probably better to avoid the need for the routine altogether in languages where the verb stem would make no sense, by changing the message (*) above to make it less explicit.
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.7}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $} L.IV.7  How to print: menus}} {
\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399947}} L.IV.7  How to print: menus
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Next, a batch of definitions should be made to specify the look of menus and which keys on the keyboard navigate through them.  "French.h" has:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057     Constant NKEY__TX     = "P = prochain    ";
\par \pard \s16     Constant PKEY__TX     = "D = dernier ";
\par     Constant RKEY__TX     = "ENTER = lire sujet   ";
\par     Constant QKEY1__TX    = "  R = retour     ";
\par     Constant QKEY2__TX    = "R = dernier carte";
\par
\par     Constant NKEY1__KY    = 'P';
\par     Constant NKEY2__KY    = 'p';
\par     Constant PKEY1__KY    = 'D';
\par     Constant PKEY2__KY    = 'd';
\par     Constant QKEY1__KY    = 'R';
\par     Constant QKEY2__KY    = 'r';
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 whereas "English.h" has:
\par
\par \pard\plain \s16 \f3\lang2057     Constant NKEY__TX     = "N = next subject";
\par \pard \s16     Constant PKEY__TX     = "P = previous";
\par     Constant QKEY1__TX    = "  Q = resume game";
\par     Constant QKEY2__TX    = "Q = previous menu";
\par     Constant RKEY__TX     = "RETURN = read subject";
\par
\par     Constant NKEY1__KY    = 'N';
\par     Constant NKEY2__KY    = 'n';
\par     Constant PKEY1__KY    = 'P';
\par     Constant PKEY2__KY    = 'p';
\par     Constant QKEY1__KY    = 'Q';
\par     Constant QKEY2__KY    = 'q';
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.8}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.IV.8  How to print: miscellaneous short messages}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399948}} L.IV.8  How to print: miscellaneous short messages
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 These are phrases or words so short that they're not worth putting in the LibraryMessages system, e.g.,
\par
\par \pard\plain \s16 \f3\lang2057    Constant SCORE__TX    = "Score: ";
\par \pard \s16    Constant MOVES__TX    = "Tours: ";
\par    Constant TIME__TX     = "Heure: ";
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 define the text printed on the ordinary status line (in English, "Score" and "Turns").  The remainder of the list is as follows:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    Constant CANTGO__TX   = "On ne peut pas aller en cet direction.";
\par \pard\plain \li720\tx284 \f4\lang2057 the "You can't go that way" message
\par \pard\plain \s16 \f3\lang2057    Constant FORMER__TX   = "votre m@^eme ancien";
\par \pard\plain \li720\tx284 \f4\lang2057 name of player's former self, after the player has become somebody else
\par \pard\plain \s16 \f3\lang2057    Constant YOURSELF__TX = "votre m@^eme";
\par \pard\plain \li720\tx284 \f4\lang2057 name of player object
\par \pard\plain \s16 \f3\lang2057    Constant DARKNESS__TX = "Obscurit@'e";
\par \pard\plain \li720\tx284 \f4\lang2057 name of Darkness place
\par \pard\plain \s16 \f3\lang2057    Constant NOTHING__TX  = "rien";
\par \pard\plain \li720\tx284 \f4\lang2057 name of the "nothing" object (caused by print (name) 0;, which is not strictly speaking legal in Inform anyway)
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    Constant THOSET__TX   = "ces choses";
\par \pard\plain \li720\tx284 \f4\lang2057 used in command printing
\par \pard\plain \s16 \f3\lang2057    Constant THAT__TX     = "@cca";
\par \pard\plain \li720\tx284 \f4\lang2057 used in command printing. There are three circumstances in which all or part of a command can be printed by the parser:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057            > TAKE OUT
\par \pard \s16            What do you want to take out?
\par \pard\plain \li2160\tx284 \f4\lang2057 [an incomplete command]
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057            > TAKE FROG
\par \pard \s16            (the lesser-spotted frog)
\par \pard\plain \li2160\tx284 \f4\lang2057 [a vague command]
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057            > TAKE FROG WITHIN CAGE
\par \pard \s16            I only understood you as far as wanting to take the frog.
\par \pard\plain \li2160\tx284 \f4\lang2057 [a command that went on too long]
\par \pard \tx284
\par \pard \li284\tx284 "those" is printed in place of a multiple object and "that" in place of a number or something not well understood by the parser (like a question topic).  Note that
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057            What do you want to
\par \pard \s16            I only understood you as far as wanting to
\par \pard\plain \tx284 \f4\lang2057
\par \pard \li284\tx284 are both library messages.  The verb is printed from its dictionar
y entry (via LanguageVerb above), and will therefore appear in the imperative.  (In English, of course, this is the same as the infinitive.)  You may therefore want to rephrase the two messages as
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057            What do want to finish the command:
\par \pard \s16            I only understood the first part of your command:
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    Constant OR__TX       = " ou ";
\par \pard\plain \li720\tx284 \f4\lang2057 in the list of objects being printed in a question asking you which thing you mean: if you can't find anything grammatical to go here, try using just ", ".
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    Constant AND__TX      = " et ";
\par \pard\plain \li720\tx284 \f4\lang2057 dividing up many kinds of list
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    Constant WHOM__TX     = "qui ";
\par \pard \s16    Constant WHICH__TX    = "lequel ";
\par    Constant IS2__TX      = "est ";
\par    Constant ARE2__TX     = "sont ";
\par \pard\plain \li720\tx284 \f4\lang2057 used _only_ to print text like "inside which is a duck", "on top of whom are two drakes"
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    Constant IS__TX       = " est";
\par \pard \s16    Constant ARE__TX      = " sont";
\par \pard\plain \li720\tx284 \f4\lang2057 used only by the list-maker and only when the ISARE_BIT is set; the library only does this from with LibraryMessages, so you can avoid the need altogether
\par \pard\plain \s17 \b\f5\fs30\ul\cf2\lang2057 \page {\cs21\super #{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super #} TransMan_L.4.9}} {\cs21\super ${\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super $}
L.IV.9  How to print: LibraryMessages}} {\cs21\super +{\footnote \pard\plain \s19 \f4\fs20\lang2057 {\cs21\super +} TransMan:399949}} L.IV.9  How to print: LibraryMessages
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 Finally, Part IV contains an extensive block of translated library messages, making up at least 50% of the language definition file.  In English they look like this:
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057   ...
\par \pard \s16   Lock:    switch(n)
\par            \{   1: if (x1 has pluralname) print "They don't ";
\par                   else print "That doesn't ";
\par                   "seem to be something you can lock.";
\par                2: print_ret (ctheyreorthats) x1, " locked at the moment.";
\par                3: "First you'll have to close ", (the) x1, ".";
\par                4: if (x1 has pluralname) print "Those don't ";
\par                   else print "That doesn't ";
\par                   "seem to fit the lock.";
\par                5: "You lock ", (the) x1, ".";
\par            \}
\par
\par   SwitchOn: switch(n)
\par            \{   1: print_ret (ctheyreorthats) x1,
\par                   " not something you can switch.";
\par                2: print_ret (ctheyreorthats) x1,
\par                   " already on.";
\par                3: "You switch ", (the) x1, " on.";
\par            \}
\par   ...
\par \pard\plain \tx284 \f4\lang2057
\par \pard \tx284 You have to translate these messages, or near equivalents to them.  It may be useful to define printing rules, just as I've done in "English.h":
\par \pard \tx284
\par \pard\plain \s16 \f3\lang2057    [ CTheyreorThats obj; if (obj has pluralname) print "They're";
\par \pard \s16      else print "That's";
\par    ];
\par \pard\plain \tx284 \f4\lang2057
\par (Thus, "ctheyorthats" is not a rule built into Inform but is one I wrote into the language definition file.)
\par }