Answer product-owner round 1: show reading a name and a personnummer through one bound sex, say what the locale address prints, and plan the record's one pick in item 4

This commit is contained in:
2026-10-05 00:44:17 +02:00
committed by Lillem4n
parent b93d47eeb2
commit 60b3cb20ca
3 changed files with 16 additions and 5 deletions
+13 -3
View File
@@ -238,7 +238,17 @@ too, so a person's prefix never contradicts it. A `personnummer`'s birth number,
for a man, which no real person is ever given.
A person of a chosen sex is assembled from the tables — `sex[f].first-name` beside
`last-name`. Skatteverket's test series is also small: a personnummer
`last-name`. `person` and `personnummer` each draw their own sex, so where a name and a
number must agree, read both through one bound `sex`:
```json
{ "format": "{first} {last}, {pnr}",
"first": "{/sv_SE.sex as s}{s.first-name}",
"last": "{/sv_SE.last-name}",
"pnr": "{date(1930-01-01,2025-12-31,'060102')}-{s.birth-number.number}{luhn()}" }
```
Renders e.g. `Anne Grönberg, 011012-2389`. Skatteverket's test series is also small: a personnummer
is one of about 70,000 values, a day in 1930–2025 against the two birth numbers, so a
fixture past a few hundred rows repeats one and a `UNIQUE` column needs a category of
your own. `sv_SE.date` and `en_US.date` are uniform over 1970-01-01 to 2029-12-31,
@@ -249,8 +259,8 @@ inside a sex.
A `geo` folder holds one tree per country under its alpha-2 code: five
[linked tables](#linked-tables) named alike, and an `address` record binding one locality
and drawing its street and postal code inside it, which the locale's `address` binds once
and prints whole.
and drawing its street and postal code inside it. The locale's `address` prints that
record, and each of its columns describes the address printed.
| Table | `geo.SE` | `geo.US` | Weight |
|-------|----------|----------|--------|
+2 -2
View File
@@ -861,8 +861,8 @@ name is an error listing both keys; select by type instead.
A Luhn-valid personnummer over a random birth number may be a living person's; 238 and
239 after any date are blocked from assignment, so the shipped `personnummer` and
`samordningsnummer` use those. They sit in a `birth-number` table under `sex` rather
than as a column of it, so a pick of a sex can read the number, which `todo.md` item 28
has `personnummer` do to agree with a person's sex, and `sex` stays one shape across locales instead of
than as a column of it, so a pick of a sex can read the number; `todo.md` item 28 has
`personnummer` read it that way, to agree with a person's sex, and `sex` stays one shape across locales instead of
collecting every sex-keyed id fact. A samordningsnummer's day, the birthday plus 60, is
drawn from 61 to 88, valid in every month, rather than computed from the date drawn.
+1
View File
@@ -231,6 +231,7 @@ Shape: T = table, t = template, c = choice.
- Fixes on the way: `{/sel}|{/sel}` panics out of `Fake` today where two draws land on rows whose cells select different rows of another table; it must render.
- Rewrites the README's References, Draw group, Correlated fields, Linked tables, Names and "One draw, one spelling" sections; the Linked tables section says which pick's weights govern a family, since the bound row decides.
- Widens the refusal of a name read once to every binding, a path into it or a reference path bound included, since `{n.x}` read once is then `{/ref.x}`, and deletes the names fence over draw groups and nested repeats (`checkUses`, `readsHeld`).
- Say how a record's columns and a struct's tags read one pick, so `sv_SE.person.first` and `sv_SE.person.sex` beside each other still describe one person.
- Re-pin seeded output and `testdata/shipped_shape.txt` in their own commits; the CHANGELOG names the grammar change.
### 57. Rewrite `CHANGELOG.md`'s `[Unreleased]` as what v0.1.0 holds.