Answer prose round 1: pick key leaves its root rule to pickKey, the worked example lists l's addressed keys, refuseTwiceDrawnIn recurses on an addressed key, the street rule and NANPA's sit where their readers look, and street_delivery cites only what its source states

This commit is contained in:
2026-10-07 01:59:09 +02:00
committed by Lillem4n
parent 5e9b60a88f
commit 9f96eb5a02
4 changed files with 27 additions and 27 deletions
+9 -9
View File
@@ -162,7 +162,10 @@ Each locale carries `address`, `color`, `company`, `date`, `email`, `first-name`
`ip`, `last-name`, `person`, `phone`, `price`, `sentence`, `sex`, `time`, `url`,
`username`, `version` and `word`, formatted per locale; `sv_SE` adds `personnummer`
and `samordningsnummer`, `en_US` adds `ssn`, `itin` and `phone-exchange` (the three
digits after the area code). `misc` carries `car`, `coordinate`, `creditcard`
digits after the area code). `en_US.phone` draws its exchange from `en_US.phone-exchange`,
which draws evenly from the codes the North American Numbering Plan Administration (NANPA)
may assign: `200` to `999`, except `211`, `311` … `911`, `555`, `950`, `958`, `959` and
`976`. `misc` carries `car`, `coordinate`, `creditcard`
(Luhn-valid), `currency` (ISO 4217), `datetime` (RFC 3339), `emoji`, `httpmethod`,
`httpstatus`, `language` (ISO 639-1, with its 639-2/T code), `loglevel` (syslog
severity), `mac`, `mimetype`, `objectid`, `port`, `protocol`, `territory` (ISO
@@ -174,10 +177,6 @@ carry sub-fields — `misc.currency.symbol`, `misc.territory.alpha2`,
`misc.territory[SE].capital` and `misc.currency[Euro].symbol` select a row; `car` and
`useragent` carry no key or name, so they are drawn from rather than selected in.
`en_US.phone` draws its exchange from `en_US.phone-exchange`, which draws evenly from the
codes NANPA may assign: `200` to `999`, except `211`, `311` … `911`, `555`, `950`, `958`,
`959` and `976`.
Where a script under [`data-import/`](data-import) reads a source, the facts come from
that source, and the script drops a row only by a rule it states; elsewhere a small hand-written
set ships, and [`todo.md`](todo.md) carries the step that replaces it (goal 14). Copy
@@ -264,9 +263,10 @@ one has no use for, and `sv_SE.title` has no `parent`, so it is selected as
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. The locale's `address` prints that
record, and each of its columns describes the address printed. Do not expect a check that a
Swedish street lies in its postort to pass: a street may sit under a neighbouring postort,
as the `street` row's counting rule explains.
record, and each of its columns describes the address printed. Do not assert that a Swedish
street lies in its postort: the import counts each road segment toward the shipped postort
owning the postal code whose centre point lies nearest, so a street may sit under a
neighbouring one.
| Table | `geo.SE` | `geo.US` | Weight |
|-------|----------|----------|--------|
@@ -274,7 +274,7 @@ as the `street` row's counting rule explains.
| `municipality` | kommun, by code or name | county, by FIPS code or name | population |
| `locality` | postort, by name; [`geo-se.py`](data-import/geo-se.py)'s `localities` picks which ship | incorporated place of 25,000 people or more with a postal code of its own, by GEOID or name; Hawaii has none | tätort population, the kommun's where the postort names it, else 200; place population |
| `postal-code` | postnummer with street delivery, by code | ZCTA, by code | one; address ranges |
| `street` | gatunamn, the ten with most road segments per postort, each segment counted toward the shipped postort whose postal code's centre point is nearest | street name, the ten with most address ranges per place | segments; address ranges |
| `street` | gatunamn, the ten with most road segments per postort | street name, the ten with most address ranges per place | segments; address ranges |
`geo.SE.region[Skåne län].municipality` draws a kommun in Skåne,
`geo.SE.locality[Lund].street` a street in Lund, and