[ . . . .
[ [orthography fromage] [category noun] [gender
masculine] [means cheese]]
. . . . ]
Let us in addition suppose that you have defined a procedure called entry which takes as input the orthographic form of some word (say "fromage) and outputs the complete entry for the word which is found in the dictionary. For now you can ignore the real details of this procedure quite easily. It is a simple matter to define a fake procedure which will produce the right kind of output - even if not by the right means - so that we can get on with other things. For instance, a crude but effective tactic would be to define entry like this:
to entry :word op [[orthography fromage][category noun][gender masculine][means cheese]] end
This procedure will output [[orthography fromage] [category noun] [gender masculine] [means cheese]] no matter what input it receives. If you say entry "cheval (or even entry "horse) you still get [[orthography fromage] [category noun] [gender masculine] [means cheese]]. But, of course, you can quickly edit the procedure definition so that entry outputs some other list when you wish. (This method of dodging a problem to focus on another is quite useful. So don't look down on it.)
Our eventual goal, in these circumstances, is to define a procedure (an operation) called article which will output the appropriate form of the French definite article when given a French word as input. Since nothing of consequence is excluded by ignoring the plural les, however, we can reasonably simplify the problem at first and focus exclusively on the three singular forms. Our immediate problem, then, is: How do you set up a definition for the operation article so that article "fromage outputs "le, while article "assiette outputs "l' and article "banane outputs "la?
to article :current.word
member? "a [a e i o
u]
will output "true
and
member? [gender feminine]
[[orthography souris][gender feminine][means mouse]]
will output
"true
In order to check if :current.word begins with a vowel (and then, if so, to output "l'), we can, therefore, use the following instruction:
if member? first :current.word [a e i o u] [op "l']
To paraphrase in English: If the first element of the thing called "current.word is a member of the list [a e i o u] then output"l'
In order to check if :current.word belongs to the feminine gender (and if so to output "la), we need to see if the sub-list [gender feminine] is included in its dictionary entry. Given our definition of entry, the expression entry :current.word will retrieve the dictionary entry (even if for the moment always the same and not always the right one). Entry : current.word is therefore the appropriate expression to use for the second input to member? The first input must be the sub-list we are attempting to find - [gender feminine]. The whole instruction reads as:
if member [gender feminine] entry :current.word [op "la]
In English: If the list [gender feminine] is a member of the entry for the thing called "current.word then output "la.
if member?
first :current.word [a e i o u] [op "l']
if member [gender
feminine] entry :current.word [op "la]
As it happens, this is indeed the appropriate order when the tests are expressed as they are. But it is important to realise that the order in which the conditional instructions appear has significant consequences. The second test (for gender) can only be expressed as succinctly as it is here when the instructions are in this order. If you know a little French, you will know that not all French words of feminine gender are constructed with the article la. The second test of the two only works correctly because it relies on the first test having filtered off (having dealt with) all vowel-initial words, no matter what their gender. If the second instructions came first, then article "assiete (since assiete is feminine) would output "la. This is not French! A partial flow diagram will perhaps help to make the point clear. (Remember that an instruction starting with op - like op "l' -shuts down its parent procedure so that no processing of subsequent instructions takes place.)


E-mail: ron.brasington@rdg.ac.uk