From 1af5abf762dd7015809d968e2e56b9df0471cf3d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 4 Oct 2026 17:46:48 +0200 Subject: [PATCH] Answer prose round 1: say NANPA may assign the codes, spell the test's exchange in full, and file the record paragraph's split --- CHANGELOG.md | 6 +++--- data-import/tsv.py | 2 +- data_test.go | 4 ++-- todo.md | 13 +++++++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a35c4ec..7def0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,9 +90,9 @@ replacement, and each removed path, column or flag. and carries the same three. `person.prefix` is null where a person has no title, where it used to be an empty string, so `--format sql` writes `NULL` and a `string` struct field reading it becomes `*string`. -- `en_US.phone-exchange` draws the three digits after a US area code, as NANPA assigns - them: `200` to `999`, never `211` to `911` ending in `11`, nor `555`, `950`, `958`, - `959` or `976`. `en_US.phone` draws its `exchange` from it. +- `en_US.phone-exchange` draws the three digits after a US area code from the codes + NANPA may assign: `200` to `999`, except `211`, `311` … `911`, `555`, `950`, `958`, + `959` and `976`. `en_US.phone` draws its `exchange` from it. - `ErrNoColumns` is exported, so a caller can tell the one record fence a path can answer from the rest. - An error names a spelling that runs: a layout is named single-quoted and free of diff --git a/data-import/tsv.py b/data-import/tsv.py index 333e9ab..eeebacc 100644 --- a/data-import/tsv.py +++ b/data-import/tsv.py @@ -5,7 +5,7 @@ from pathlib import Path def write(path, columns, rows): - """Write the rows as a TSV; the table needs two rows, and every cell is stripped, and must be non-empty and free of tabs, newlines and braces.""" + """Write the rows as a TSV of at least two rows, each cell stripped, non-empty and free of tabs, newlines and braces.""" lines = ["\t".join(columns)] for row in rows: cells = [str(row[c]).strip() for c in columns] diff --git a/data_test.go b/data_test.go index a92c7b8..8f9b0d0 100644 --- a/data_test.go +++ b/data_test.go @@ -341,8 +341,8 @@ func TestShippedUSPhone(t *testing.T) { if m == nil { t.Fatalf("phone %q does not match %s", n, re) } - if exch := m[1]; exch[1:] == "11" || unassignable[exch] { - t.Fatalf("phone %q has the unassignable exchange %s", n, exch) + if exchange := m[1]; exchange[1:] == "11" || unassignable[exchange] { + t.Fatalf("phone %q has the unassignable exchange %s", n, exchange) } } } diff --git a/todo.md b/todo.md index eb5c2f9..578a955 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 9` -`Next ID = 87` +`Next ID = 88` | Goal | W | |---|---| @@ -65,6 +65,7 @@ | 26 | 0.1.0 | defect | **Give a `sv_SE.personnummer` over 100 the `+` separator Skatteverket spells, or stop drawing birthdates that reach 100.** | 2 | 2 | 5 | 8 | 4 | 21.1 | | 34 | 0.1.0 | | **Add `{isin()}`, `{cusip()}`, `{aba()}` and `{vin()}`.** | 2 | 4 | 6 | 7 | 4 | 20.9 | | 5 | 0.1.0 | | **Run the nine-seat comprehension panel after the draw restructure, and file what it names.** | 1 | 3 | 3 | 9 | 3 | 20.4 | +| 87 | 0.1.0 | | **Split the README's record paragraph into one paragraph per rule, and name the shapes and the hold it refers to.** | 1 | 2 | 4 | 6 | 3, 11.3 | 17.3 | | 71 | 0.1.0 | | **Accept a name as a `calc` operand, so `{calc(n * 2)}` computes from the pick `{n}` prints.** | 3 | 4 | 5 | 7 | 5.3 | 17.2 | | 79 | 0.1.0 | decision | **Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach.** | 6 | 6 | 7 | 8 | 12 | 13.7 | | 58 | 0.2.0 | | **Ship prebuilt binaries, a container image, and packages for Homebrew, Scoop and the biggest Linux package managers, so the CLI needs no Go.** | 3 | 7 | 8 | 9 | 1.1, 7 | 29.2 | @@ -108,7 +109,7 @@ | 30 | 0.3.0 | | **Draw `email.local` from `username`, so the two share one handle list.** | 2 | 2 | 3 | 5 | 5.7 | 11.5 | | 40 | 0.3.0 | | **Parse `defaultTable`'s path with the library's grammar.** | 2 | 2 | 3 | 5 | 5.7 | 11.5 | | 75 | 0.3.0 | | **Run every README `sh`, `go` and `text` example as a test, and compare each "Renders" line to a seeded render.** | 2 | 6 | 4 | 7 | 11.2 | 11.5 | -| 86 | 0.3.0 | | **Read `en_US.phone`'s area codes from one category, as its exchange reads `en_US.phone-exchange`.** | 1 | 2 | 2 | 5 | 3.2 | 11.5 | +| 86 | 0.3.0 | | **Read both `en_US.phone` formats' area codes from one category, as their exchange reads `en_US.phone-exchange`.** | 1 | 2 | 2 | 5 | 3.2 | 11.5 | | 33 | 0.3.0 | | **Group `data/misc` into folders where a group name makes a path easier to guess.** | 4 | 5 | 4 | 5 | 5 | 10.8 | | 47 | 0.3.0 | defect | **Refuse a category naming a hidden rows file, `"rows": ".x.tsv"`, as a rows file that is not there.** | 1 | 1 | 2 | 5 | 6 | 10.2 | | 72 | 0.3.0 | principle | **Fail the merge gate when test coverage falls below the last recorded figure.** | 2 | 3 | 2 | 5 | 3 | 10.2 | @@ -171,7 +172,7 @@ Shape: T = table, t = template, c = choice. |---|---|---|---| | `ein` valid ranges | t | IRS | facts | | `company` names, suffix, `naics` | t+T | SEC tickers for patterns, NAICS 2022 | public domain | -| `phone` NANP with valid NPA/NXX | t | NANPA rules | facts | +| `phone` NANP with valid NPA (the NXX ships as `en_US.phone-exchange`) | t | NANPA rules | facts | | `routing` ABA with check, `bankaccount` | t | Fed prefix ranges | facts | | `licenseplate` per state | T | hand-authored patterns | facts | | `car` make, model | T | NHTSA vPIC | public domain | @@ -241,6 +242,10 @@ The format hard-codes `-`, and the 1930 floor makes the oldest draws invalid fro Needs item 4. +### 87. Split the README's record paragraph into one paragraph per rule, and name the shapes and the hold it refers to. + +Needs item 4, which rewrites the draw-group rule this paragraph states. The paragraph under Records, from "The columns are the point" to "Correlated fields", holds six rules, so "put a value two fields share in its own category" is hard to find. "Renders as either shape" names no shape nearby, and "a field hold" is no term the README defines. + ### 71. Accept a name as a `calc` operand, so `{calc(n * 2)}` computes from the pick `{n}` prints. `checkCalc` and the value proof read an operand as a sibling field, so `{calc(n * 2)}` is refused with `no field "n"` today. Item 4 stops an operand holding its field for the expansion, after which a name is the one way to show the operand a calc computes from, as the README's Computation example does. @@ -390,7 +395,7 @@ The CLI counts brackets of its own, so a change to the selector grammar desyncs `readme_test.go` loads and renders each `json` block, but runs no `sh` example (CLI, Records, Table, Linked tables), no `go` example (Library) and no `text` block of error text, and compares no "Renders e.g." output, so goal 11.2 is not met. -### 86. Read `en_US.phone`'s area codes from one category, as its exchange reads `en_US.phone-exchange`. +### 86. Read both `en_US.phone` formats' area codes from one category, as their exchange reads `en_US.phone-exchange`. Both phone formats carry the same 21-code `area` list, so an edit to one copy can miss the other.