Inform 7 update?

But an object can have only one printed name at the same time. The same problem is in English with a/an (and proper/improper-named objects). When the game reads player input it should (IMHO) understand even if the article is wrong (just like it now understands TAKE A APPLE or ENTER AN CAR), unless you’re making a language-learning tool or something similar where you want to force proper grammar.

Oh, right, I said “printed name”. I’m sorry, I was referring to “Understand” tokens.

But yeah, if not implementable, then I’m all for the engine ignoring some of the subtleties. After all, if the player types “examinar casa”, then it’s a fair bet he’ll be using “entrar nela” or “examiná-la” next, instead of using the article for “edifício”.

It depends on how powerful the parser needs to be. Do we really need it to parse “examinar maçã” (“x apple” - female), “examinar bolo” (“x cake - male”), “comê-la” (“eat it” - female), “comê-lo” (“eat it” - male") as having the player examine the apple, then the cake, then eating the apple, then eating the cake? I don’t think so, really. It’s not an issue that comes up in English, which is why we can have separate pronouns for it, them, him, her (and oh boy, in Portuguese at least the pronouns for female people are the same for female objects, how’s that for confusion?). When translating we have to ask how necessary it really is to keep all that.

EDIT - However, I just noticed that it’s not really comparable to “a/an”, because “a/an” is essentially the same article with a letter added if the next word begins with a vowel. The difference between “a machine” and “an elephant” is not the same as between “uma máquina” (female) and “um elefante” (male), and Inform-wise this becomes relevant and apparent when you start distinguishing genders in people. If you do, it’s natural to distinguish genders in objects.

But again, this might be more trouble than it’s practically worth it. It might be simple just to allow some objects to have multiple genders, depending on the understand tokens, and be done with it. Sure, there will be some confusion eventually, but much less, I think, than the bother of being grammar-perfect.

The problem is only partly with the player’s input.
In English X IT can only refer to something inanimate. Whereas in Portuguese (judging from Peter Pears’s example) EXAMINA-LA and EXAMINA-LO (X HIM and X HER) will have to refer indiscriminately to any object (since any object, animate or inanimate) may be masculine under one description (o edicificio – the he-building) but feminine under another description (la casa – the she-house). So a pronoun will always refer to the last mentioned object (which can be annoying to the player).

But there is also a problem with the game’s outpout. Portuguese responses to commands can’t refer to anything as ”it” but only as ”she” or ”he” (as ”la” or ”lo” or whatever the correct form is in Portuguese). So a response such as “Firsting taking it off” needs to make a choice between “First taking her off” and “First taking him off”, and that choice should be based on the gender of the synonym used for the object in the player’s command responded to (and not on the gender of the internal name of the object).

It seems to me that in an ambiguous language such as English, “First taking it off” is quite enough. Perhaps for other languages and other outputs it would be enough to simply say “First taking (the noun) off”?

But of course, output is tricky. Because “it” is always it: “x apple”, “eat it”. Response: “(first picking it up) You eat it.” Consider, say, Portuguese: “x maçã”, “comê-la” (or “come-a”). Response: “(apanhando-a primeiro) Tu come-la.” Gramatically correct, rather ugly, but that’s beside the point. Consider that the response could also have been “(pegando nela)” for picking it up.

For all this, it would make more sense to simply go with the simplest output: optionally do away with “it” and replacing it with the noun. It would be unrealistic to ask for the engine to deal with all these variants itself.

Or maybe the house/building can accept both masculine and feminine pronouns. Still seems the simplest way to do it.

Actually, it would be interesting to have input from the extension writers for the Spanish, French, German and Italian extensions and libraries. Maybe they’ve sorted this mess all out a long time ago.

EDIT - In fact, it might be as simple as allowing for a gender-based system. The current system, the English one, is also of gender - but it assumes only three forms, because male/female will always be people, and “them” is plural regardless of gender. If it were allowed to be overriden with a gender-based system, the pronouns were set as “male”, “female”, “neuter” (not used in Portuguese, but used in, say, German), “male plural”, “female plural” and “neuter plural”, then it would make sense to discard the whole concept of “him/her”, instead of creating loops for the system to recognise it. Then the user can just program, say, “a/-a/ela/nela/na/-na” for reffering to “female single”.

Well, if any object (or at least any inanimate object) could take both feminine and masculine synonyms, then, for players to be able by default to use both feminine and masculine pronouns for a single object, either the author needs a way to set more than one gender to a single object, or pronouns mustn’t discriminate between objects based on their gender (since it’s not the objects that have a gender in most languages but the nouns for them).

I had a quick look at it when writing the Swedish extension (which had to add a fourth gender to the language); obviously I can’t be sure, but I don’t think they’ve hit upon a solution. (The German extension is a quite complex affair though, so I suppose there may be something hidden away somewhere in there that takes care of the issue.)

In effect that is how Inform does it at present (only you set those values in the I6 Language Template).

English Inform already has a problem with number: “a bunch of marbles” or “some marbles.”

The “main gender” (that is the one that correlates with the printed name) is given to an object with one of the attributes male, female, neuter, or plural-named. The German plural is gender-independent, so we implemented it as a fourth gender.

[color=blue]The apple is an edible thing in the garden. It is male.
The pear is a female edible thing in the garden.

This sounds strange, but people got used to it (and there will soon be an alternative way). The gender information is used to print the article in the correct grammatical case and to set the suffixes for adjectives and nouns (in printed names), and the pronouns.

For dictionary words that have a different grammatical gender than the printed name, we are using a concept we refer to as “Changing Gender” or “CG”. The author can add one of the labels (m, f, n, or p [masculine, feminine, neuter, plural]) to the dictionary word directly in the Understand-phrase.

[color=blue]Understand “Apfel”, “Frucht [f]”, or “Fruechtchen [n]” as the apple.

The word “Apfel” does not have to be labelled, because it is of the same gender as the printed name. The pronouns are set according to the dictionary word the player uses to address the object.

We are about to offer an alternative method to set the main gender directly in the printed name, in order to create formal analogy between the output and the input definitions:

[color=blue]The apple is an edible thing in the garden. The printed name is “Apfel[-s][m]”.
The pear is an edible thing in the garden. The printed name is “Birne[f]”.

([-s] is a suffix for masculine genitives, [m]/[f] set the grammatical gender of the fruit.)

Note that the VM format allows flags to be attached directly to dictionary words. I6 only uses this to mark words “plural”, “verb”, “noun”, “adjective” (really preposition), and “meta”. Eleven bits are unused in Zcode, more in Glulx.

Grammatical gender could be added here, although it would require an I6 patch.

It would be really neat if the dictionary parameter bits could be used to set the gender of a noun word at compile time. I experimented with that possibility, but (incapable of applying compiler patches) I tried setting the gender-bits at runtime (when play begins) which worked at least for Glulx, if I recall correctly.

Our CG method, though, has turned out to be pretty stable. The CG markers are GPRs (represented in I7 by “understand tokens”) that are interpreted as prepositions, so they are overread by the parser; in these routines, the changing gender is referenced to the object (in an array with 8 entries called CG_buffer). Linking a dictionary word to the respective object is something that would have to be done even if the gender would be coded in the dictionary parameters, doesn’ it?. (As long as there is no way of checking the context of a dictionary word.)

I forgot what the specific issue with this was, but now I remember: It often makes sense to set the “a bunch of” phrase as the indefinite article. But then you need to use a different verb depending on whether or not the noun occurs with the definite or indefinite article.

Another number issue is that you might want to support this:

x bunch of marbles. take it
x marbles. take them

That is, set pronouns based on the referring phrase, not an inherent property of the objects. This is theoretically possible in Inform (because dict words can have a “plural” flag) but the parser doesn’t do it.