Blog post: 16 Sep 2026 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 (cmudict Y , ipa /j/ ). The word <hour> starts with a consonant letter ( <h> ) but a vowel sound (cmudict AW , ipa /aʊ/ ).…