English: A vs. An

redblobgames.com

182 points by azhenley 10 hours ago


eviks - 4 minutes ago

Interesting analysis

> [LLM It doesn’t need to be clean or maintainable. It only needs to be correct

But correctness is precisely the issue with LLMs?

But also

> I would’ve spent more time on the trie simplification algorithm and less time on parsing cmudict and re-learning d3.js.]

You could've spent nothing on D3 because the result is bad/poorly readable - much worse than a simple table alphabetically-aligned interception table, which I could use to answer curious questions such as "how can I compare "A" and "O" in terms of exceptions? or "which letter has the most exceptions"?")

(and the blue color is out of place, vowel/consonant split should visually be the same "category", not black/colord. Red for exceptions is fine)

hbn - 8 hours ago

A funny quirk of English I never noticed until I started learning Spanish:

In Spanish, to say for example, "he is a doctor," you would say "él es médico." Which more literally translates to "he is doctor," which feels unintuitive coming from English. Spanish DOES have an equivalent for "a" - "un/una", so the natural thing for an English speaker to say would be "él es UN médico", but I understand that to be awkward/unnatural.

But then I realized, when you say the same sentence in plural - "they are doctors" - you don't have an article. You don't say "they are some doctors" (I had to Google, apparently "some" isn't an article anyway?)

So Spanish ends up more consistent - Singular: "Él es médico." Plural: "Ellos son medicos."

Unlike English - Singular: "He is a doctor." Plural: "They are doctors."

theanonymousone - an hour ago

The most problematic for me as a non-native has been "the" vs "nothing", i.e. when one can/should put the definite article.

Pre-LLM I was joking that real AI is whatever can make that decision correctly 100% of times.

abraxas - 9 hours ago

What gets me as a non-native speaker far more than "a vs an" is the "a vs the" conundrum. I still don't quite get when something needs to be "indefinite" and I've been speaking English for close to forty years. My native tongue lacks articles altogether and it's soo bloody hard I feel hopeless I'll ever master them fully.

shagie - 8 hours ago

It's avoiding two distinct vowel sounds in succession.

Consider other variations of this rule.

In French, one would say "l'hôpital" rather than "le hôpital" because the 'h' is an aspirated breath (try saying "a aspirated" rather than "an aspirated") leading to an initial vowel sound.

In Irish, the word for father is "athair". To say "her father" it becomes "a hathair" https://en.wikipedia.org/wiki/Prothesis_(linguistics)

In Turkish, it can be seen with araba (car). "I saw the car" -> "Arabayı gördüm." (note the 'y' to avoid two vowels). Book is kitap and "I saw the book" is "Kitabı gördüm." Which doesn't need the additional consonant sound between the final sound and the "ı".

Whatever language you speak, it likely has some form of this rule.

And other languages have the quirk too (like the "a unicorn" or "a university"). For example, in French there's l’hôtel and l'hôpital. But if you've got the hedge... it's la haie... or even more egregiously, the marmoset is le ouistiti.

nivertech - 18 minutes ago

  “a San Francisco startup” /ə ˌsæn frənˈsɪskoʊ ˈstɑɹtˌʌp/
  vs
  “an SF startup” /ən ˌɛsˈɛf ˈstɑɹtˌʌp/
i.e. you have to mentally pronounce the phrase before choosing which form of the indefinite article to write
tarkin2 - an hour ago

He says he should have used an LLM to write his one-off code

I guess this is a common idea now

Yet since a lot of our coding is for one-offs then we are allowing LLMs to blunt our skills

mh-cx - an hour ago

Non-native speaker here. To me in spoken language both "unicorn" and "hour" have a combination of 2 vowels in the beginning. Let me transcribe them as "ee-oo" and "aa-oo" here.

Why is the aa-oo combination at the beginning of "hour" considered a vowel but the ee-oo in "uniform" is a consonant?

Dwedit - an hour ago

There's also "the" vs "the". As in "the boy ate the apple". First 'the' ends with a schwa sound. Second 'the' ends with 'ee' sound.

vbernat - 3 hours ago

"anorack" is a specific spell checker to tell if we need "a" or "an". It uses espeak to decompose a word into phonemes.

MathMonkeyMan - 3 hours ago

Is it "a LLM" or "an LLM"?

More generally, do you choose the article as if the first letter of the initialism were pronounced or as if the first word of the initialism were pronounced? Does it differ with acronyms? Does it differ between the UK and America?

hiccuphippo - 2 hours ago

So is it "a historic" or "an historic"? I've heard Stephen Colbert use "an historic" with a non-silent H.

throwawayk7h - 9 hours ago

I'm always curious why sometimes I pronounce the as /ðə/ ("thuh") and sometimes as /ði/ ("thee"). I don't really know what governs this but I expect it's the presence of a vowel at the start of the following word. However, only some vowels. Does anyone have an answer?

xelxebar - 5 hours ago

The one that gets me is when people use "a" with initialisms, e.g. "She drives a RV," just sounds off to me. she can do her thing but I drive an RV.

That said, I think the former might be more common these days, so arguably the rules might just differ between written an spoken English in some dialects.

outlore - 2 hours ago

An actual use case for Jev?

jan_m_savage - 3 hours ago

Every language has its own quirks. In Chinese, you don't have this a/an difficulty, but the grammatical tenses are so fluid that a lot of contextual cues are needed to make sense whether "I went" [zoule 走了] means I really went in the past, or I am going now (ignoring the semantic diff as well, since zou also means to pass away).

Rendello - 6 hours ago

Starting earlier today, I've been using Firefox's local translation feature to auto-translate every page to Italian (to learn). I just had to remove English from my language list and check an option to translate English to Italian.

Firefox's local translation is pretty decent but not amazing. It did render this article's title as "Italiano: A vs. An", which I found pretty funny.

tikhonj - 2 hours ago

One fun thing is that some words can reasonably go either way: "a hotel" vs "an hotel" or "a SQL query" vs "an SQL query".

dearjames - 8 hours ago

This reminds me of the multiple AI videos out there that I have to involuntarily listen to because people hate using earphones/headphones. They just start off like "The man/woman blah blah blah", and my poor brain is always noting that's bad English/grammar or whatever because What man/woman are you talking about? Where did he/she come from in this story that you just started telling?

at1as - 3 hours ago

english is my second language, but I learned it early enough that I didn't have to study the rules (and it more or less replaced my mother tongue).

Years later a friend who was learning english asked me the difference between "a" and "an" and I realised I had no idea. I know when to use each, but not the rule governing why.

Fascinating how different the experience learning a language can be when do you explicitly, through learning the structure and rules, versus via immersion where you know what's right, but perhaps not why.

YoshiRulz - 7 hours ago

For anyone interested in getting "more 9s" from the heuristics and then building something useful with it, come join us at https://www.wikifunctions.org/wiki/Z32314

steve_taylor - 2 hours ago

It really grinds my gears when someone says “an year”.

mauvehaus - 9 hours ago

Fun fact an adder (snake) was once a nadder, and an apron was on a napron. This fun fact brought to you by The History of English Podcast.

https://historyofenglishpodcast.com/

Happily sourced in Wikipedia so I don't have to figure out which episode I learned that from:

https://en.wikipedia.org/wiki/Adder <- see below the table in Taxonomy.

mkatx - 8 hours ago

I always wondered if some uses of the word 'and' I notice on occasion might have similar explanations, or if they were the result of misspelling, mistyping, incorrect autocorrect, etc.. anyone know?

Examples from published articles: "Barely half and hour was on the clock" "the hospital, which is in and area of central Homs" "spiraled into and armed uprising and civil war" "During and interview with ABC in July"

bradrn - 8 hours ago

i think this post with more details would be a better link: https://www.redblobgames.com/x/2635-a-vs-an/. The graph of exceptional cases is particularly interesting.

(Besides, it clarifies the colour scheme — the red vs black went totally unnoticed to my colourblind eye.)

prometheus1992 - 8 hours ago

I can tell you did not use AN llm to write this post. Thanks.

loloquwowndueo - 8 hours ago

> for some words, we use an. For example, an apple.

The rule is fairly simple as it was taught to me - if the word (apple) begins with a vowel sound, use “an” to avoid cacophony. Same way one uses “o” (means “or” in Spanish) but “u” if the next word begins with a vowel.

What matters is the sound though, not the character - so it’s not as trivial to algorithmize. Eg. A hammock, an hour.

dataflow - 9 hours ago

Any verdict for "historic"?

pyuser583 - 5 hours ago

That’s confusing because I was taught whether something is vowel or consonant is the spoken, not written, truth.

pvillano - 8 hours ago

"a whole nother" is one of my favorite linguistic quirks.

kstrauser - 7 hours ago

Confession: Whenever I hear an American say "an historic...", pronouncing the "h", I roll my eyes at the pretense. That's the only word I think I've ever heard someone swap in "an" for "a" before a pronounced consonant.

Now, if they used the British-style "an 'istoric event", that's fine. In American we don't pronounce the "h" in "herb", so someone here saying "an herb garden" would follow the rule correctly and sound normal.

But "history" with the full "h"? To me it screams "this person memorizes without understanding", or at least "this person desperately wants to sound posh but fails". It's the verbal equivalent of wearing a polo shirt with a giant logo, imagining if a tiny one is fancy, then an enormous one must surely be exactly what rich people would wear.

zem - 8 hours ago

"if words starts with hones" fails for "hones" itself; I suspect that should have been "honest" in the code.

- 5 hours ago
[deleted]
moritzwarhier - 8 hours ago

This is one of the examples where English is perfectly consistent.

edit: OK, the ("a") "nvidia employee" seems to provide a counterexample, but is it really about names? I think it's about repetition, "an Nvidia employee" just sounds strange due to the "en-en".

But yeah, maybe it is a rare exception, because "an n-gram" is probably standard.

I'm perfectly fine with applying the rule to all other proper names? E.g. "a Microsoft employee" or "an HSBC product".

The writeup lost me there, when it jumps to hard-codes lists using this example as justification. AI slop?

> The actual rule is not whether the written word starts with a vowel letter, but whether the spoken word starts with a vowel sound.

The only exemption I know about is emphasis by pause, it allows to use "a" before a vowel sound in some exceptional cases.

So the rest of the goal description is solely about how words are pronounced? I mean that the question whether to use "a" or "an", and wanting to define a function that decides this, is equivalent to aiming at a function that decides whether the pronunciation of a word starts with an audible consonant or vowel.

This is described on the site, I see now. But it jumps to data science and statistics before even stating the problem accurately?

I still don't know what kind if "exceptions" it talks about, because it already treats things like "an HN submission" as an "exception", when it clearly isn't one.

jonplackett - 7 hours ago

A while ago I made an algorithm to swap the gender in fairy stories.

(Genderswappedstories.com)

And I found another English weirdness trying to swap between his/him and her/hers.

Him always swaps to her

Eg it was him - it was her

But his can swap to her or hers

It is his -> it is hers

It is his thing -> it is her thing.

And her can also swap to him or his

It was her -> it was him

It was her thing -> it was his thing

And hers always swaps to his.

So hers and him are the only completely predictable - and they don’t even mean the same thing!

I had to write a very in-depth algorithm to work out the type of words surrounding the words - if they are nouns, adjectives etc - in each sentence to correctly guess the swaps. But even after that some were unpredictable due to word order keeping the important words apart. all I could do 100% reliably was to flag the ones that might be ambiguous to check. Of course now I could just get an LLM to check it!

Can anyone explain why this happens?

nephihaha - 8 hours ago

I notice "an" is in decline in some forms of spoken English. I noticed this shift years ago. Some English speakers say "a (y)apple" rather than "an apple" or "a(y) orange" rather than "an orange". In some case the "y" sound is replaced by a glottal stop (a' apple, a' orange).

[Why is this getting voted down? Bizarre.]

kichimi - 9 hours ago

I've spent some time thinking about this before, and it provides a clue about the writers accent. For example:

"An 'H'", and "a 'H'" are both equally valid following this rule (by my interpretation), depending on how you pronounce the letter 'H'.

mococa - 8 hours ago

As a non speaker, I really hate this rule

habanany - 9 hours ago

[dead]