English: A vs. An
Article URL: https://www.redblobgames.com/blog/2026-09-16-english-a-vs-an/ Comments URL: https://news.ycombinator.com/item?id=49769944 Points: 203 # Comments: 276
English uses an indefinite article, either a or an, before a word. For instance, a raccoon contrasts with an apple. When generating text programmatically, a function a_or_an( apple ) could determine which article to use. This appears to be a simple task—simply checking the first letter to see if it is a vowel. However, this approach would lead to incorrect output such as an unicorn instead of a unicorn.
The actual rule relies on whether the spoken word starts with a vowel sound, not the written word's starting letter. For example, unicorn begins with the vowel letter u but a consonant sound (/j/), whereas hour starts with a consonant h but a vowel sound (/aʊ/). Curious about how frequently these exceptions occur, and if they can be grouped together, the author spent a day examining data, creating visualizations, and writing up their findings. Surprisingly, only 129 out of 32,455 words in their list necessitated exceptions.
Written by urgent.news from Hacker News Best's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- English: A vs. An redblobgames.com