English: A vs. An
Recorded: Sept. 19, 2026, 10 p.m.
| Original | Summarized |
English: a vs an English: a vs an from Red Blob Games’s Blog Home Blog Links Bluesky About Blog post: In English, there is an “indefinite” article a that can go before a word. For example, a raccoon. But for some words, we use an. For example, an apple. When procedurally generating text, I want a function The actual rule is not whether the written word starts with a Visualization showing whether the first two letters of a word are enough to determine whether it should have “a” or “an” I was curious how often these exceptions occurred, and whether they can be grouped together, so I spent a day looking at the data and building some visualizations and wrote up the results. [LLM note: I did not use LLMs to write any of this code, but in hindsight, I should have. This is one-off code to answer a question. It doesn’t need to be clean or maintainable. It only needs to be correct. I would’ve spent more time on the trie simplification algorithm and less time on parsing cmudict and re-learning d3.js.] Email me redblobgames@gmail.com, or comment here: Load comments from Disqus Copyright © 2026 Red Blob Games RSS Feed Created 16 Sep 2026; |
The text explores the nuanced rules governing the usage of the indefinite articles "a" and "an" in English, moving beyond the superficial rule of starting letters to focus on phonetic sounds. The author posits that the determination of whether to use "a" or "an" is based on whether the spoken word begins with a vowel sound or a consonant sound, rather than the written letter. This distinction introduces exceptions to a simple letter-based rule, exemplified by words such as "unicorn," which begins with the vowel letter 'u' but is pronounced with a consonant sound, and "hour," which begins with a consonant letter 'h' but is pronounced with a vowel sound. The author developed a concept for a function, a_or_an("apple"), intended for use in procedurally generating text, to address this phonetic complexity. The process of establishing this rule involved an empirical investigation into exceptions, where the author analyzed a list of thirty-two thousand four hundred and fifty-five words. This analysis revealed that only one hundred twenty-nine of these words required exceptions to the general rule, suggesting the existence of significant, yet relatively small, deviations from the simple vowel/consonant correlation. To visualize these findings and understand the distribution of these exceptions, the author created data visualizations. The author also provided a reflective note regarding the development process, acknowledging that the generated code was created without the use of large language models, emphasizing that the primary goal was correctness, and noting areas where further time could be allocated to more complex algorithmic components such as trie simplification and parsing. |