@finbheara/domain 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -3
- package/dist/chunks/{place-6qvca8eg.js → place-75ms9pvh.js} +1 -1
- package/dist/clrg-regions.js +1 -1
- package/dist/geocode.js +76 -67
- package/dist/place.js +1 -1
- package/dist/school.js +1 -1
- package/dist/types/geocode.d.ts +1 -0
- package/dist/types/place-towns.d.ts +1 -1
- package/dist/types/place-within.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,6 +100,7 @@ p.region; // "IDTANA-MARO"
|
|
|
100
100
|
|
|
101
101
|
place("Calgary, AB").pl2; // "CAN-AB/calgary"
|
|
102
102
|
place("Co. Cork").region; // "MUNSTER"
|
|
103
|
+
place("Co. Louth").region; // "ULSTER": the council that runs it, not its province
|
|
103
104
|
place("CA").arm; // "ambiguous": California or Canada
|
|
104
105
|
place("Dublin").arm; // "ambiguous": Ireland, California or Ohio
|
|
105
106
|
|
|
@@ -132,15 +133,21 @@ geocode("Prague", { near: "RCCEA", declared: true }).isPlace();
|
|
|
132
133
|
// no namesake town is read
|
|
133
134
|
geocode("Fife").isPlace(); // false: a town of Washington, and a council area
|
|
134
135
|
// of Scotland
|
|
136
|
+
geocode("Prague").isPlace(); // false: a town of Oklahoma, and the capital of
|
|
137
|
+
// Czechia
|
|
138
|
+
geocode("Prague, Oklahoma").pl3; // "USA-OK/prague"
|
|
135
139
|
```
|
|
136
140
|
|
|
137
141
|
The layer reads a bare town by its name alone, so it reads one only where nothing contradicts
|
|
138
142
|
it. A context (a `country` or `near`, read by the store, never as a town of the layer) that
|
|
139
143
|
reads to ONE place which neither holds the town nor shares its country stops the layer: `Prague`
|
|
140
144
|
near `RCCEA` and `Whitecross` under `Ireland` and `Ulster` read nothing. A context the store
|
|
141
|
-
reads nothing for, or reads as several places, stops nothing
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
reads nothing for, or reads as several places, stops nothing. A town named like a GeoNames admin2
|
|
146
|
+
area of those six countries that does not hold it (`Fife`) reads only where a qualifier or a
|
|
147
|
+
context places it. So does a town named like a capital or a major city elsewhere (a `cities500`
|
|
148
|
+
place outside the six countries that is a capital or holds a million people, and is more populous
|
|
149
|
+
than the town): bare `Prague` and `Copenhagen` read nothing, where they would read the towns of
|
|
150
|
+
Oklahoma and New York, and `Prague` in a USA context is the Oklahoma town. A print with a
|
|
144
151
|
qualifier (`Yonkers, NY`) is never stopped: the context never overrules the print.
|
|
145
152
|
|
|
146
153
|
A `Place` is one of four arms: `resolved`, `plural` (a print naming more than one place),
|
|
@@ -169,6 +176,10 @@ resolvePhrase("Derry in Ireland"); // ["ULSTER"]
|
|
|
169
176
|
`resolvePhrase` answers every region a phrase supports, and `[]` where it supports none. A
|
|
170
177
|
token that names places in two regions resolves only with a co-token that settles it.
|
|
171
178
|
|
|
179
|
+
A region is always the CLRG council that runs a place, and never its province or state where
|
|
180
|
+
the two differ. County Louth lies in the province of Leinster and is run by the Ulster council,
|
|
181
|
+
so it reads `ULSTER`, as Northern Ireland reads `ULSTER` and Wales `ENG_MIDLANDS`.
|
|
182
|
+
|
|
172
183
|
## Read a school name
|
|
173
184
|
|
|
174
185
|
```ts
|
package/dist/clrg-regions.js
CHANGED
|
@@ -201,7 +201,6 @@ var IE_COUNTIES = {
|
|
|
201
201
|
kilkenny: "LEINSTER",
|
|
202
202
|
laois: "LEINSTER",
|
|
203
203
|
longford: "LEINSTER",
|
|
204
|
-
louth: "LEINSTER",
|
|
205
204
|
meath: "LEINSTER",
|
|
206
205
|
offaly: "LEINSTER",
|
|
207
206
|
westmeath: "LEINSTER",
|
|
@@ -221,6 +220,7 @@ var IE_COUNTIES = {
|
|
|
221
220
|
fermanagh: "ULSTER",
|
|
222
221
|
londonderry: "ULSTER",
|
|
223
222
|
derry: "ULSTER",
|
|
223
|
+
louth: "ULSTER",
|
|
224
224
|
monaghan: "ULSTER",
|
|
225
225
|
tyrone: "ULSTER"
|
|
226
226
|
};
|