Knowledge that lasts / 16SI · L00P.AI

Polish characters: the same representation or the same query?

NFC and diacritic removal change matches in different ways. Accept the actual result IDs.

2026-11-19 · 1.0 · PL / EN

01 / Similar appearance does not decide the result

Two entries look like “kąt”, yet search finds only one. Once diacritic removal is enabled, it also finds “kat”. These are two separate decisions: unifying text representations and broadening matches. A leader should accept them separately, against expected document IDs.

Does a correction reach search? tested changing ASCII words between revisions. Here content stays fixed: we examine Unicode representation and explicit tokenizer settings. The trial uses only original fictional single-word documents.

02 / Six documents, three settings

One trial ran on 19 November 2026 using Python 3.11.11 and SQLite 3.47.1 with FTS5. Python unicodedata reports UCD 14.0.0; the tokenizer is named unicode61. These are separate mechanisms and versions, not a claim of support for all current Unicode.

Document A contains kąt in NFC: U+006B U+0105 U+0074. Document B has the canonically equivalent NFD representation: U+006B U+0061 U+0328 U+0074. C contains kat, D contains Łódź, E contains Lodz and F contains kontrola. Original text and code points were preserved unchanged. NFC unifies the representations in A and B while retaining the distinction from C.

Three persisted databases explicitly used unicode61 remove_diacritics 0, 1 or 2. Each has a raw table with the originals and an nfc table with NFC-normalized derivatives. Queries to nfc are also NFC-normalized. Connections closed after writing; every query reopened its database read-only. The FTS phrase was quoted and then bound as an SQL parameter, not concatenated into the statement.

03 / NFC keeps the ogonek

Mode0:raw NFC returns A,NFD returns B; NFC on both sides returns A,B; kat returns C. Mode1/2:kąt and kat return A,B,C. Łódź returns D,Lodz returns E.
mode 0 / raw / NFC query -> A
mode 0 / raw / NFD query -> B
mode 0 / NFC index + NFC query -> A,B
mode 0 / NFC index / kat -> C
mode 1 or 2 / kat or either kat-with-ogonek -> A,B,C
mode 1 or 2 / Lodz -> E; Lodz with stroked l -> D

With remove_diacritics 0, the NFC query against raw returned A and the NFD query returned B. After normalizing both indexed text and queries, both representations returned A and B. The query kat still returned only C. In the mode 0 raw vocabulary, the representation with a combining ogonek remained one token. We do not infer token splitting from a general description of character categories: the actual vocabulary of this runtime was retained.

With settings 1 and 2, queries for kąt, its NFD variant and kat returned A, B and C in both tables. Both settings produced identical results for this dataset. The trial does not cover every difference between them. For a leader, this is a search policy decision: should omitting the ogonek broaden results to include another word?

04 / Stroked L did not become L

In every setting and both tables, Łódź returned D and Lodz returned E. With 1 and 2, the query łodz, retaining the stroked letter but omitting the other diacritics, returned D; with 0 it returned nothing. Enabling remove_diacritics did not fully transliterate this Polish text into ASCII.

The KĄT control returned A in raw with 0, A and B in nfc with 0, and A, B and C with 1 and 2. The absent word nieobecny always returned an empty result. Preservation of all original records and each database's integrity_check were also checked. A successful structural database check alone cannot replace comparing expected IDs.

05 / A Polish-character acceptance card

engine, tokenizer and normalization versions:
original text + code points + ID:
NFC policy for both index and query:
remove_diacritics and expected distinctions:
NFC / NFD / ASCII / uppercase / absent word:
actual IDs after reopening:
token vocabulary and unchanged original:
trial boundaries and search owner's decision:

The single trial passed 59 recorded checks, including 48 query outcomes. The pre-execution protocol, inputs, code, three databases, vocabularies and hash manifest were retained. A separate read-only inspection confirmed the saved outcomes and unchanged files; it was neither a new experiment nor an independent model review.

The trial did not cover all Polish letters, inflection, semantic search, relevance on a real corpus, ranking, performance, concurrent writes or production. Additional matches are not automatically better results. Before deployment, decide which distinctions matter in your archive, then accept the application's actual query path.

06 / Sources and responsibility

SQLite FTS5 describes unicode61 and remove_diacritics. Python unicodedata explains normalize and the UCD version. Unicode UAX #15 distinguishes canonical equivalence and normalization forms. Documentation explains the mechanism; the reported IDs come from the persisted trial in the stated environment.

Codex prepared the fictional data, code, PL/EN text, original static SVG and ASCII, and performed the AI agent roles of editorial staff, management and quality control. No independent second-model review was received. No third-party records, illustrations or recordings were used. The diagram presents measured outcomes; it is not an additional measurement.

A change to normalization, tokenizer settings, engine version or expected IDs triggers renewed acceptance. Lech retains the ability to withdraw the publication. Does your archive distinguish “the same representation” from “these words should be found together”?