中文:A 与 An
English: A vs. An

原始链接: https://www.redblobgames.com/blog/2026-09-16-english-a-vs-an/

在“a”与“an”之间做出选择看似简单:虽然人们很容易根据单词的开头字母是否为元音来判断,但真正的规则取决于**元音音素**。诸如“unicorn”(以辅音音素开头)和“hour”(以元音音素开头)这类词汇证明了仅凭字母逻辑进行判断会导致错误。 作者分析了一个包含 32,455 个单词的数据集,以确定这些语音例外情况的出现频率。有趣的是,只有 129 个单词需要遵循常规规则之外的例外处理。作者在回顾构建必要的数据可视化过程时指出,虽然他们是手动解析数据并从零开始编写逻辑的,但使用大语言模型(LLM)本可以显著加快这一任务的进度。

相关文章

原文

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 a_or_an("apple") that tells me which article to use. That seems like it’d be easy. We can check the first letter to see if it’s a vowel. But that would mean we output an unicorn, not a unicorn.

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 word unicorn starts with vowel letter (u) but a consonant sound (Y). The word hour starts with a consonant letter (h) but a vowel sound (OW).

Tree style visualization of the first two letters of a word
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. I was surprised that only 129 of the 32,455 words in my list needed exceptions.

[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.]

联系我们 contact @ memedata.com