logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

English: A vs. An

Original article
redblobgames.com|329 points|445 comments|by azhenley|Sep 19, 2026

English Grammar: Choosing Between "A" and "An"

Originally published on the Red Blob Games Blog on September 16, 2026.

In the English language, we use an indefinite article (either "a" or "an") before certain words. When I am working on procedural text generation, I need a programmatic way to decide which one to use. Specifically, I want a helper function:

a_or_an("apple") →\rightarrow→ returns "an"

The Core Logic

Many people assume the choice depends on the first letter, but that is incorrect. The actual rule is based on the phonetic sound at the start of the spoken word, not the written character.

Comparison of Exceptions

WordStarting LetterPhonetic Sound (IPA)CMUdictCorrect Article
Unicornu (vowel)/j/ (consonant)Ya
Hourh (consonant)/aʊ/ (vowel)AWan

To visualize this decision process:

Data Analysis

I spent a day investigating how frequently these phonetic exceptions occur and whether they follow any group patterns. My workflow included:

  • Analyze a dataset of words.
  • Create data visualizations.
  • Document the findings.

Visualization of first two letters vs article choice

I discovered that the number of exceptions is surprisingly low. Out of a total of 32,45532,45532,455 words, only 129129129 required an exception to the basic vowel-letter rule. The ratio of exceptions is:

Exception Rate=12932,455≈0.39%\text{Exception Rate} = \frac{129}{32,455} \approx 0.39\%Exception Rate=32,455129​≈0.39%

Implementation Reflection

# Conceptual implementation
def a_or_an(word):
    if starts_with_vowel_sound(word):
        return "an"
    return "a"

Note from the author: I didn't utilize LLMs to write the code for this project. Looking back, I realize I should have. Using an LLM to handle the cmudict parsing and the d3.js visualizations would have freed up my time to develop a more sophisticated trie analysis algorithm.


Get in touch:

  • Email: redblobgames@gmail.com
  • Discussion: [Load comments from Disqus] or [View the discussion thread]