Urgent.News

What's breaking now, across thousands of outlets.

Tech

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.

Read the original at redblobgames.com →

More in Tech

Some Space Optimisations

Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k MY FIRST APPROACH: A very valid…

  • First approach uses dictionary to store indices of array values
  • Second approach optimizes space with set of size k
  • Both methods find indices i, j with nums[i] == nums[j] and |i - j| = k

1,558 Tests Green and No Auth: The Tests That Never Actually Ran

A test named test_all_adapters_importable asserted nothing. It would pass forever, even if every adapter was broken. 57 of 65 assertion files were in the wrong format, and the harness returned 0 / 0…

  • Three issues cause green test suites with no actual tests.
  • 57 assertion files in wrong format in planner-critic-engine module.
  • CauterRule v0.3.0 reports 1,558 green tests due to missing import.

More from Saturday 19 September →