Skip to content

fix(indexes): file accented titles under their base letter - #118

Merged
19-84 merged 2 commits into
mainfrom
fix/title-bucket-diacritics
Sep 30, 2026
Merged

19-84 merged 2 commits into
mainfrom
fix/title-bucket-diacritics

Conversation

@19-84

@19-84 19-84 commented Sep 30, 2026

Copy link
Copy Markdown
Owner

The title index sent every title not starting with ASCII a–z to 0-9, including accented Latin. So Émile, über, Ñandú and İstanbul all landed in the catch-all. On a French, German or Spanish subreddit, much of the title index was one 0-9 page.

Change

The first character is NFKD-folded to its base letter before bucketing, in both places that bucket:

  • html_modules/html_static_indexes.py letter_bucket(): static mode (Python unicodedata)
  • core/postgres_database.py _TITLE_BUCKET_SQL: dynamic mode (PostgreSQL normalize(…, NFKD), built in, no extension)
Title before after
Émile Zola 0-9 e
über alles 0-9 u
İstanbul news 0-9 i
Apple (fullwidth) 0-9 a
日本語 / Привет / مرحبا 0-9 0-9
ßtraße / Æsir / Øresund 0-9 0-9 (no decomposition)

Bucket names are unchanged (a–z, 0-9), so URLs are unchanged. Re-exported archives just re-file those titles. No expression index uses the SQL, so there is no migration.

Tests

  • New SQL/Python parity test. Nothing previously checked that the two bucketers agree. The test runs _TITLE_BUCKET_SQL against 19 titles and compares with letter_bucket(). I confirmed it fails when only the Python side changes (Émile Zola: '0-9' != 'e').
  • Updated letter_bucket unit tests. The old test_non_ascii_goes_to_catchall asserted Émile → 0-9; that is exactly the behavior this PR changes.
  • Full suite: 992 passed. ruff clean. pyright 0 errors.

Also marks the item done in the Unicode roadmap spec.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MjiSEYcZ2q8F7bke96VGHT

19-84 and others added 2 commits September 30, 2026 02:07
letter_bucket() sent every title not starting with ASCII a-z to '0-9',
including accented Latin (Émile, über, Ñandú), so French/German/Spanish
title indexes collapsed into one catch-all page. NFKD-fold the first
character to its base letter in both the Python bucketer (static mode)
and _TITLE_BUCKET_SQL (dynamic mode), and add a test that pins the two
together; there was none, so they could drift silently.

Non-Latin scripts and letters without a decomposition (ß, Æ, Ø) still
go to '0-9'. No expression index uses the SQL, so no migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MjiSEYcZ2q8F7bke96VGHT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MjiSEYcZ2q8F7bke96VGHT
@19-84
19-84 merged commit 91d096e into main Sep 30, 2026
11 checks passed
@19-84
19-84 deleted the fix/title-bucket-diacritics branch September 30, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant