"A" vs "An"

This isn’t exactly a lynch pin of anything, but is there an easy way to solve for the use of “an” where “a” should be used?

For example, the indefinite article returns “an” for “an unique”. I assume the logic is simply based on the letter that is first encountered in the printed name other than the article, but doesn’t take into account pronunciation. I imagine that the best programmatic approach would be to check for the first two letters, and if the pattern is “u[consonant][vowel]” make sure it is “a” and not “an.” There’s no way I’m going to define a table of all the words that need this treatment on a one-by-one basis instead!

I could fiddle with figuring out the best way to insert this logic into the indefinite article code myself, but is anyone charitable enough that you could share a solution for this and save me the trouble? Perhaps it’s already been written somewhere in an extension or something?

The indefinite article of the unique is "a".

(This is assuming that there is an object called “unique”, and you want to set the article on a per-object basis. If you have variable printed names, it will be more work.)

This will give you “a uninformed person,” and… well, the other examples I can think of are loan word and/or ambiguous in pronunciation like “ululate” and “Upanishad,” but I think you’re going to have to define a table of exceptions somehow, unless you can come up with a regex to determine when “un-” is a prefix and when it’s part of the word.

Rats. I guess it is probably impossible to do it universally and programmatically. Darn English! :stuck_out_tongue: