Capitalization of "your" using the [The noun] text variable

Apologies – when I tried to search for this, the forum search straight-up told me it ignored 2/3 of my keywords. Go figure.

Anyway, I’m encountering an oddity where if I use “[The noun]” in an action rule, nouns whose names begin with “your” are not properly capitalized; they stay lowercased. When I submit a command that uses “my” instead of “your” to refer to the noun, it works fine, so I7 does understand that “your” is a special word.

Is it just that I7 doesn’t understand “your” as the definite article in this circumstance? The official documentation in §5.3 doesn’t mention possessives at all.

(I also poked around with [possessive] in printed names out of curiosity/frustration, but that doesn’t seem to compile; I guess it’s usable only in some kinds of text.)

Can you post an example text?

Sure. It happened to multiple things, which I ended up just rephrasing so that the noun wouldn’t be at the beginning of the response, but it would have been something like:

[code]
Things can be receptive or unreceptive. Things are usually unreceptive.

Your head and your torso are parts of the player.
Your hair is a part of your head.

Pasting is an action applying to two things.
Check pasting:
if the noun is unpasteable:
say “You can’t see any way to paste [the noun] to something else.” instead;
otherwise if the second noun is unreceptive:
say “[The second noun] doesn’t seem to have anyplace to paste things.” instead;
otherwise if the player does not carry the noun:
try taking the noun.[/code]

Which would have returned “your head doesn’t seem to have anyplace to paste things”.

Looks like a bug. This is a solution:

      say "[The second noun] doesn't seem to have anyplace to paste things." in sentence case instead;

Yup, the weird thing is that when I tried this:

[code]Lab is a room.

Things can be pasteable or unpasteable. Things are usually unpasteable.

Things can be receptive or unreceptive. Things are usually unreceptive.

Your head and your torso are parts of the player.
Your hair is a part of your head.

The player carries a post-it. The post-it is pasteable.

Pasting it to is an action applying to two things. Understand “paste [something] to [something]” as pasting it to.

Check pasting:
if the noun is unpasteable:
say “You can’t see any way to paste [the noun] to something else.” instead;
otherwise if the second noun is unreceptive:
say “[The second noun] doesn’t seem to have anyplace to paste things.” instead;
otherwise if the player does not carry the noun:
try taking the noun.[/code]

I got “your head” and “your hair” but “Your torso.”

Well spotted. The index map tab reveals objects “Your head” and “Your hair”, but “your torso”, which is a reasonable interpretation of the source. But for some reason the capitalization is getting inverted when printed at the start of a sentence.

If we change the code to

Your head and Your torso are parts of the player.

we get “Your torso” in the index map tab, but now we get "your torso … " in the check rule response.

Well spotted in turn! So a workaround for the original problem is to define everything in the source code as lowercase “your”:

[code]Lab is a room.

Things can be pasteable or unpasteable. Things are usually unpasteable.

Things can be receptive or unreceptive. Things are usually unreceptive.

your head and your torso are parts of the player.
your hair is a part of your head.

The player carries a post-it. The post-it is pasteable.

Pasting it to is an action applying to two things. Understand “paste [something] to [something]” as pasting it to.

Check pasting:
if the noun is unpasteable:
say “You can’t see any way to paste [the noun] to something else.” instead;
otherwise if the second noun is unreceptive:
say “[The second noun] doesn’t seem to have anyplace to paste things.” instead;
otherwise if the player does not carry the noun:
try taking the noun.[/code]

I’ve reported it as a bug. Looking at the Index for the version with “your torso,” the printed name for “Your head” is “your head” and the printed name for “your torso” is “your torso.”

It looks like, in some sense, Inform thinks that something created as “Your head” should be a proper-named thing with an initial “Y,” like a book (or album) called My Life In the Bush of Ghosts. Then the correct behavior would be for the “Y” to be capitalized everywhere. But Inform also recognizes in some way that this isn’t likely for “your,” so it lowercases the printed name… except along the way it doesn’t do whatever it is that ensures that objects with lowercase printed names get an initial capital at the start of a sentence.

What would be ideal here is something that let us set the definite article to “your,” so Inform wouldn’t have to treat it as proper-named at all. But as far as I know there’s no way to specify the definite article.

Oh, wow. That’s a lot more complicated of an explanation than I expected (although a simple workaround)! I also appreciate the “sentence case” workaround; I tunnelvisioned onto capitalization and didn’t search the documentation for “case”. This is also a good reminder that I should make better use of the index map tab, especially when trying to troubleshoot.

Many thanks to all!

Update regarding the bugginess of “your”: it looks like if you put “your” at the beginning of a printed name rather than just the normal name, the [they] grammar token won’t capitalize properly no matter what. Printed-naming it with lowercase “your” means it will be printed lowercase even if you specify [They] and even at the beginnings of sentences with “in sentence case”. Printed-naming it with uppercase “Your” will print it uppercase in the middles of sentences and lowercase it everywhere, including sentence beginnings, if “in sentence case” is used.

I think that’s something that happens with explicitly set printed names. If the printed name isn’t capitalized, then a text substitution with a capital letter won’t capitalize it, whether or not the word “your” is involved. If the printed name is “florp florp”, then it’ll print as “florp florp” even if invoked with a “[The second noun]” substitution.

This might make a little more sense if you consider that usually proper nouns will be capitalized wherever they appear (and thus capitalized in the printed name) while improper nouns will be prefaced by “the” (so “[The second noun]” becomes “The florp florp” and you don’t worry about capitalizing the “f”). Unfortunately, since you can’t set the definite article to “your” or anything, this becomes awkward because you have something that you don’t want to use “the” with but that isn’t really a proper noun either. Unfortunately, if you want to handle this I think you need to do a sentence case workaround or something like that.

No, that’s part of the bugginess. I’m saying that the sentence case workaround doesn’t work when specifically using the [they] grammar token to refer to something whose printed name begins with “your”, to the point where it will go out of its way to lowercase a sentence-initial printed name that’s been hardcoded with a capitalized initial “Your” (but still leave a “your” printed name lowercase, rather than straight-up toggling). This is in contrast to my original issue with [the noun]/[The noun] (which does behave properly once upon application of “in sentence case”, just as jrb suggested!).

Can you show me an example of this? I’m not sure I follow what you’re saying here, and if there’s an example it’ll be easier to report it as a bug.

I know it’s been, uh, nearly four years (sorry), but I’m seeing something that I think is related to this. I’ve created a rule for printing names of people that tries to take familial relationships and whether the player knows the person into account. Here it is:

Rule for printing the name of a person (called P) (this is the more general or specific names rule):
	if P is the player:
		say "[they]";
	otherwise if the player is abstract or the player is incorporeal or P is abstract or P is incorporeal:
		say "[the printed name of P]";
	otherwise if P is known by the player:
		if P is a relative of the player:
			casually address P as the player;
		otherwise:
			say "[short name of P]";
	otherwise:
		say "a [generic name of P]".

When using this, [they] in the rule always ends up printing as “you”, regardless of whether [the player] or [The player] is used. I can’t figure out a generic way to have the case match the substitution’s case.

Of course I’m a total newbie, so maybe I’m just missing something.

First, it seems like this might be better positioned as a new topic instead of a continuation of an old thread. At the very least, you would be able to select a solution if one is found, which you won’t be able to do on this thread. Perhaps a moderator can split it out?

Second, it’s not clear what problem you are describing. The "[they]" substitution never produces capitalized text – that’s why "[They]" exists separately. Where are you using "[the player]" vs. "[The player]" and expecting it to matter? (Neither substitution appears in the rule that you included.)

1 Like

Thanks for the suggestion; I was on the fence about resuming an old thread, so next time I’ll start a new one.

You’re right, of course. For some reason I was thinking Inform did automatic capitalization in some spots, but now that I’m scanning the documentation again, it looks like it doesn’t really. I’m obviously growing senile in my middle age. :sweat:

In any case, it looks like my initial approach of doing To say the (P - a person) and To say The (P - a person) is the way to go; I shouldn’t be trying to stick any articles or pronouns into this rule. I’ll carry on from there. Thanks again for your help!