Indefinite articles...

I’ve looked all over the manual, though I am sure I’ve missed it–when you change the indefinite article of a noun to something else–from ‘a/an’ to ‘the’, or some other word–how do you change it back to the correct ‘a’ or ‘an’?? It’s probably ridiculously simple, I know, but I have tried–

now the indefinite article of the noun is "a".

Which does the job, but is incorrect if the noun begins with a vowel, and of course “an” would be incorrect in the other case.
Inform rejects “a[n]” and “a[an]”, and if I use “a/an”, it actually results in ‘a/an iron key’.

In my practice game, I have an action that changes the state of an object, after which the name of the object becomes, for example, ‘the accursed iron key’(things having an either/or of holy or accursed, accursed objects having ‘the’ as the article, and an ‘Understand’ phrase for the ‘accursed’). I have another action that reverses this state, but I am having trouble returning the indefinite article to the more obscure ‘an’(for the iron key).

Niggling.

Have you experimented with “now the key is proper-named/now the key is not proper-named” ? I believe this allows you to strip articles from names of people and titles of things.

From example Gopher Wood in 3:18

Instead of examining the bearded man for the first time: now the printed name of the bearded man is "Japheth"; now the bearded man is proper-named; say "You peer at him a bit more closely and realize that it's Japheth."

Thanks, Hanon, but I have tried ‘now the noun is improper-named’–it seemed to have no affect, it stayed as ‘the iron key’. (my desired affect is ‘an iron key’.)

Try “now the noun is not proper-named”.

Okay I just tried that, too. But it’s still ‘the iron key’ in my inventory.

Are you setting both the indefinite article and the proper-named property? Don’t do both, just set proper-named.

If you can do what you need using the proper-named/improper-named flag, or using the variant text substitutions [foo]/[a foo], then that’s probably the way to go.

If you really do need to revert the indefinite article, you could save the original article as a property.

Article Suite is a room

A thing has a text called the original article. 
When play begins:
	repeat with X running through things:
		now the original article of X is the indefinite article of X.

Prefacing it with is an action applying to one visible thing and one topic. Understand "preface [something]  with [text]" as prefacing it with.
Carry out prefacing something with:
	now the indefinite article of the noun is the substituted form of "[the topic understood]".
After prefacing something with: try looking.

Resetting is an action applying to one thing. Understand "reset [something]" as resetting.
Carry out resetting something:
	now the indefinite article of the noun is the original article of the noun.
After resetting: try looking.

An orange and a plum are in Article Suite.

Test me with "preface orange with my / preface plum with your / reset orange / reset plum".

Or here’s a hacky (and not quite perfect) way of doing it on the fly.

To reset the article of (X - a thing):
	if the printed name of X in lower case exactly matches the regular expression "<aeiou>.*":
		now the indefinite article of X is "an";
	otherwise:
		now the indefinite article of X is "a".

Or maybe there’s a simple I6 inclusion that will accomplish the same thing? (I don’t know one.)

Edit: or I could just wait for zarf to show me some magic.

To reset the indefinite article property, set it to “”, which is the default value.

Now that I look, proper-named is not the correct solution to this problem. A proper-named object takes no article (“Bob”). What you want to do is set the indefinite article to “the” and then reset it to “”.

Thanks, Zarf! (slapping my head)

That’s amazing!

That’s probably close enough for government work, since you can just overload that phrase when required:

To reset the article of (X - herb garden): now the indefinite article of X is "an".

Actually I’d say the indefinite article of the herb garden is “a”. But for the hour, the heir and the honour, I agree it would be no big deal to set them separately. (And we’d have to do it anyway, even using the zarf magic, since the default is “a”.)

A thought struck me just now, that maybe if we declared “An heirloom is a thing in the study”, then Inform would know to set the indefinite article to “an”. It doesn’t, which seems a pity.

Inform has some funky I6 code to guess whether to print “a” or “an”–it evaluates the string it’s going to print, looks at the first character to see if it’s a vowel, and prints “a” or “an” based on that. (I think this is the PrefaceByArticle routine.) Some background here and my code starts here.

I have some code that’s designed to provide a hook into I6 so you can run your own code to figure out whether the article should be “a” or “an,” which would allow you to program in exceptions for words like “hourglass” and “uranium,” but last I checked IIRC it would occasionally put in line breaks where they shouldn’t be. Overloading the reset the article phrase is probably a good idea! Though you’d also have to do it When Play Begins.

Another thing you could do is give some things a default indefinite article property, and in the reset the article phrase you could check to see if the item has a default indefinite article, and if it does set the indefinite article to that.

One thing about the indefinite article is that, if it can appear in sentence-initial position, you want to check whether your hand-rolled indefinite articles are getting capitalized properly. (I think some of the default Inform messages may have been designed not to put indefinite articles in sentence-initial positions because Inform didn’t always handle capitalized indefinite articles. I wouldn’t at all be surprised if part of the reason you get “box (open)” rather than “open box” is that Inform used not to be able to look ahead and check whether the first letter of the thing it was about to print was a vowel.)

As I understand it, there lies the point of contention between the American and British way of pronunciation. Alas, I backed the wrong horse, being an RP speaker, as the ‘h’ is silent in US pronunciation, not British.

True, I didn’t really consider how to do it on a purely practical level, just that this would be a neat opportunity for baseline-with-exception type code.

Is there a flag for “this should be written in the beginning of a sentence” behavior?

I think it’s just that you write “[An item]” instead of “[an item]”. And it may be automatically capitalized even if you’ve set the article by hand… in fact I’m pretty sure it is. So the concern is moot, never mind. (The article-messing code I have is really only for when lots of random words can get stuck in front of the noun’s name. I think I started it because I didn’t realize that Inform had a default look-ahead.)