diff --git a/CHANGELOG.md b/CHANGELOG.md index ae5e331..a35c4ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,8 +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 a central office code NANPA can assign: `200` to `999`, - never `N11`, `555`, `950`, `958`, `959` or `976`. `en_US.phone` draws its `exch` from it. +- `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. - `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/README.md b/README.md index 201ac22..6e9b4ee 100644 --- a/README.md +++ b/README.md @@ -161,16 +161,17 @@ which binds a [name](#names), nor be `-`, which a struct tag reserves; dot-prefi 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`. `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 3166-1), `timezone` (IANA), `tld` (IANA root -zone), `useragent` and `uuid` (v4). Many carry sub-fields — `misc.currency.symbol`, -`misc.territory.alpha2`, `misc.httpstatus.code` — which `--list` shows. `car`, -`currency`, `httpmethod`, `httpstatus`, `language`, `loglevel`, `mimetype`, `port`, -`protocol`, `territory`, `timezone`, `tld` and `useragent` are [tables](#table), so +`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` +(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 +3166-1), `timezone` (IANA), `tld` (IANA root zone), `useragent` and `uuid` (v4). Many +carry sub-fields — `misc.currency.symbol`, `misc.territory.alpha2`, +`misc.httpstatus.code` — which `--list` shows. `car`, `currency`, `httpmethod`, +`httpstatus`, `language`, `loglevel`, `mimetype`, `port`, `protocol`, `territory`, +`timezone`, `tld` and `useragent` are [tables](#table), so `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. diff --git a/data/en_US/phone.json b/data/en_US/phone.json index 30d4483..74ddd35 100644 --- a/data/en_US/phone.json +++ b/data/en_US/phone.json @@ -1,15 +1,15 @@ [ { - "format": "({area}) {exch}-{line}", + "format": "({area}) {exchange}-{line}", "weight": 2, "area": ["202", "212", "213", "305", "312", "404", "415", "469", "503", "512", "602", "617", "646", "702", "718", "720", "737", "773", "786", "808", "917"], - "exch": "{.phone-exchange}", + "exchange": "{.phone-exchange}", "line": "{digits(4)}" }, { - "format": "{area}-{exch}-{line}", + "format": "{area}-{exchange}-{line}", "area": ["202", "212", "213", "305", "312", "404", "415", "469", "503", "512", "602", "617", "646", "702", "718", "720", "737", "773", "786", "808", "917"], - "exch": "{.phone-exchange}", + "exchange": "{.phone-exchange}", "line": "{digits(4)}" } ] diff --git a/shippedindex.go b/shippedindex.go index f6a96ea..a14a807 100644 --- a/shippedindex.go +++ b/shippedindex.go @@ -13,7 +13,7 @@ var shippedIndex = map[string]shippedEntry{ "en_US.itin": {paths: []string{"", "area", "group", "serial"}}, "en_US.last-name": {paths: []string{"", "count", "name"}}, "en_US.person": {paths: []string{"", "first", "last", "prefix", "sex"}}, - "en_US.phone": {paths: []string{"", "area", "exch", "line"}}, + "en_US.phone": {paths: []string{"", "area", "exchange", "line"}}, "en_US.phone-exchange": {paths: []string{""}}, "en_US.price": {paths: []string{"", "amt", "cents"}}, "en_US.sentence": {paths: []string{"", "adj", "noun", "prep", "verb"}},