R94 casing: initcap capitalises every word, so multi-word register names come back wrong #113
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap#113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope: the shared R94 casing-normalisation idiom, and the three layers that use it.
MML's registers store most rows in capitals, so
places,railways(#86) andstations(#81) all normalise on the way in with the same expression:Postgres
initcapstarts a new word at every non-alphanumeric character, so itcapitalises the second word of a multi-word name as well as the first. Finnish does not:
a place name whose second element is a common noun keeps it lower-case.
What was measured (live DB,
fi_paikannimi, 2026-08-13):and so exposed to this.
since the #81 review:
AALTO-YLIOPISTO→ "Aalto-Yliopisto" (Finnish wantsAalto-yliopisto) and
HELSINGIN YLIOPISTO→ "Helsingin Yliopisto" (Helsinginyliopisto).
PASILA, TAVARA→ "Pasila, Tavara" is fine, because therethe second element is being used as a name part.
A second shape of the same bug, from #92: the break can happen inside a word.
initcapstarts a new word after a colon as readily as after a space, soS:T MICHEL→ "S:T Michel" — the abbreviation for Sankt comes back with itssecond letter capitalised, where Swedish/Finnish usage is S:t Michel. This is worth
keeping separate from the multi-word cases when picking a rule: "capitalise only the
first word" (option 1 below) does not fix it, because
S:Tis the first word. Itneeds the tokeniser to stop treating
:as a word boundary at all.Scope note, measured after #81 merged: the 14201 traffic-site series carries no
S:-prefixed rows today (0 Finnish station names beginS:, and 0 mixed-case 14201rows contain a run of capitals), so this shape is currently latent for
stations. #92recorded it against the places series, where
conf/fimap.yaml's places commentdocuments it. It is the same expression in both, so any fix has to cover it.
Why the obvious fixes are each partial:
genuine two-part proper names, and the register does not mark which is which.
15 of the 47 have a cased variant anywhere in
fi_paikannimi. Concretely,Aalto-yliopistodoes exist cased (under kohdeluokka 42101), butHELSINGIN YLIOPISTOhas no cased row at all — so this fixes under a third of them and leavesthe more visible one broken.
Cheap and targeted, but it is a word list that has to be maintained, and it is the
kind of per-country special-casing the project usually pushes back on.
Decision needed: which rule, and whether it lives in one shared SQL helper rather
than being copy-pasted into three configs — right now the same
CASEexpression iswritten out separately in
conf/fimap.yaml(twice, rail and metro branches), and inthe
placesandrailwaysqueries. Whatever the rule turns out to be, it should be inone place, because the
stationsprincipal-station match depends on the station nameand the town name being normalised identically (#81) — two copies that drift apart
would silently empty the importance-3 rung.
Note this is not Finland-only in principle: any register that ships all-caps names hits
it. Finland is just where it is measurable today.
From the #81 review — the limitation is documented in docs/country-finland.md ("Names
are register names, casing-normalised on the way in") and was accepted there as a known
limit rather than patched per-layer. #92 (closed by #81, which applied the idiom to
stations) flagged and accepted the same limit from the other end; this issue is theone that actually fixes it.
Result is in #130 — #130; the review note is the PR description.