@mailwoman/core 10.3.0 → 10.5.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/data/PROVENANCE.md +14 -14
- package/data/libpostal/README.md +15 -15
- package/data/libpostal/dictionaries/README.md +3 -3
- package/lib/api/APIClient.ts +3 -3
- package/lib/api/ckan.ts +1 -1
- package/lib/api/clock.ts +1 -1
- package/lib/api/disk-storage.ts +4 -4
- package/lib/api/ogc.ts +9 -9
- package/lib/api/pacer.ts +1 -1
- package/lib/api/responses.ts +6 -6
- package/lib/api/retry.ts +2 -2
- package/lib/api/test/clocks.ts +2 -2
- package/lib/api/test/transport.ts +1 -1
- package/lib/coarse-placer/coarse-placer.ts +1 -1
- package/lib/decoder/build-tree.ts +1 -1
- package/lib/decoder/parse-diff.ts +3 -3
- package/lib/decoder/serialize/json.ts +1 -1
- package/lib/decoder/serialize/xml.ts +1 -1
- package/lib/env/env-file.ts +71 -0
- package/lib/env.ts +15 -9
- package/lib/fs/delimited.ts +3 -3
- package/lib/fs/formatters.ts +1 -1
- package/lib/fs/readers/stat.ts +16 -1
- package/lib/fs/readers.ts +18 -2
- package/lib/fs/zip.ts +1 -1
- package/lib/geocode/result.ts +8 -4
- package/lib/html/document.ts +1 -1
- package/lib/html/elements.ts +3 -3
- package/lib/json.ts +1 -1
- package/lib/layers/coverage.ts +3 -3
- package/lib/layers/manifest.ts +2 -2
- package/lib/layers/publication.ts +1 -1
- package/lib/layers/schema.ts +1 -1
- package/lib/license/docs-site.ts +1 -1
- package/lib/license/record.ts +3 -4
- package/lib/module/compiled-freshness.ts +6 -2
- package/lib/numeric.ts +2 -2
- package/lib/pipeline/runtime-pipeline.ts +47 -9
- package/lib/pipeline/span-proposer.ts +2 -2
- package/lib/pipeline/types.ts +153 -6
- package/lib/pipeline.ts +6 -0
- package/lib/postcode-prefix-files.ts +87 -0
- package/lib/promises.ts +12 -0
- package/lib/release-config.ts +7 -0
- package/lib/resolver/coverage-facts.ts +3 -3
- package/lib/resolver/lookup-types.ts +7 -6
- package/lib/resolver/referential.ts +1 -1
- package/lib/resolver/types.ts +6 -0
- package/lib/resources/libpostal.ts +51 -3
- package/lib/resources/whosonfirst/placetypes/graph.ts +2 -2
- package/lib/resources/whosonfirst/placetypes/specificity.ts +2 -2
- package/lib/scripting/utils.ts +1 -1
- package/lib/tokenization/normalizer.ts +1 -1
- package/lib/trust-policies.ts +1 -1
- package/lib/types/classifier.ts +1 -1
- package/lib/utils/chunk-process.ts +1 -1
- package/lib/utils/system.ts +1 -1
- package/out/api/APIClient.d.ts +2 -2
- package/out/api/APIClient.js +1 -1
- package/out/api/APIClient.js.map +1 -1
- package/out/api/ckan.d.ts +1 -1
- package/out/api/clock.d.ts +1 -1
- package/out/api/clock.js +1 -1
- package/out/api/disk-storage.js +4 -4
- package/out/api/disk-storage.js.map +1 -1
- package/out/api/ogc.d.ts +8 -8
- package/out/api/ogc.js +8 -8
- package/out/api/ogc.js.map +1 -1
- package/out/api/pacer.d.ts +1 -1
- package/out/api/pacer.js +1 -1
- package/out/api/responses.d.ts +4 -4
- package/out/api/responses.js +6 -6
- package/out/api/responses.js.map +1 -1
- package/out/api/retry.d.ts +2 -2
- package/out/api/retry.js +1 -1
- package/out/api/test/clocks.js +2 -2
- package/out/api/test/transport.d.ts +1 -1
- package/out/coarse-placer/coarse-placer.d.ts +1 -1
- package/out/coarse-placer/coarse-placer.js +1 -1
- package/out/decoder/build-tree.js +1 -1
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/parse-diff.d.ts +3 -3
- package/out/decoder/parse-diff.js +2 -2
- package/out/decoder/serialize/json.js +1 -1
- package/out/decoder/serialize/xml.d.ts +1 -1
- package/out/decoder/serialize/xml.js +1 -1
- package/out/env/env-file.d.ts +26 -0
- package/out/env/env-file.d.ts.map +1 -0
- package/out/env/env-file.js +60 -0
- package/out/env/env-file.js.map +1 -0
- package/out/env.d.ts.map +1 -1
- package/out/env.js +15 -10
- package/out/env.js.map +1 -1
- package/out/fs/delimited.d.ts +3 -3
- package/out/fs/delimited.js +3 -3
- package/out/fs/formatters.d.ts +1 -1
- package/out/fs/formatters.js +1 -1
- package/out/fs/readers/stat.d.ts +9 -1
- package/out/fs/readers/stat.d.ts.map +1 -1
- package/out/fs/readers/stat.js +16 -0
- package/out/fs/readers/stat.js.map +1 -1
- package/out/fs/readers.d.ts +14 -2
- package/out/fs/readers.d.ts.map +1 -1
- package/out/fs/readers.js +17 -2
- package/out/fs/readers.js.map +1 -1
- package/out/fs/zip.d.ts +1 -1
- package/out/fs/zip.js +1 -1
- package/out/geocode/result.d.ts +17 -5
- package/out/geocode/result.d.ts.map +1 -1
- package/out/geocode/result.js +8 -4
- package/out/geocode/result.js.map +1 -1
- package/out/html/document.d.ts +1 -1
- package/out/html/document.js +1 -1
- package/out/html/elements.d.ts +2 -2
- package/out/html/elements.js +3 -3
- package/out/json.d.ts +1 -1
- package/out/json.js +1 -1
- package/out/layers/coverage.d.ts +3 -3
- package/out/layers/coverage.js +2 -2
- package/out/layers/manifest.d.ts +2 -2
- package/out/layers/publication.d.ts +1 -1
- package/out/layers/publication.js +1 -1
- package/out/layers/schema.d.ts +1 -1
- package/out/license/docs-site.d.ts +1 -1
- package/out/license/docs-site.js +1 -1
- package/out/license/record.d.ts.map +1 -1
- package/out/license/record.js +3 -4
- package/out/license/record.js.map +1 -1
- package/out/module/compiled-freshness.d.ts +1 -1
- package/out/module/compiled-freshness.d.ts.map +1 -1
- package/out/module/compiled-freshness.js +6 -2
- package/out/module/compiled-freshness.js.map +1 -1
- package/out/numeric.js +2 -2
- package/out/pipeline/runtime-pipeline.d.ts +15 -0
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +25 -5
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-proposer.d.ts +1 -1
- package/out/pipeline/span-proposer.js +1 -1
- package/out/pipeline/types.d.ts +150 -6
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +1 -1
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline.d.ts +2 -2
- package/out/pipeline.d.ts.map +1 -1
- package/out/pipeline.js +1 -1
- package/out/pipeline.js.map +1 -1
- package/out/postcode-prefix-files.d.ts +45 -0
- package/out/postcode-prefix-files.d.ts.map +1 -0
- package/out/postcode-prefix-files.js +64 -0
- package/out/postcode-prefix-files.js.map +1 -0
- package/out/promises.d.ts +7 -0
- package/out/promises.d.ts.map +1 -1
- package/out/promises.js +10 -0
- package/out/promises.js.map +1 -1
- package/out/release-config.d.ts +7 -0
- package/out/release-config.d.ts.map +1 -1
- package/out/release-config.js.map +1 -1
- package/out/resolver/coverage-facts.d.ts +3 -3
- package/out/resolver/lookup-types.d.ts +7 -6
- package/out/resolver/lookup-types.d.ts.map +1 -1
- package/out/resolver/referential.d.ts +1 -1
- package/out/resolver/referential.js +1 -1
- package/out/resolver/types.d.ts +11 -1
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js.map +1 -1
- package/out/resources/libpostal.d.ts +22 -3
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/libpostal.js +44 -4
- package/out/resources/libpostal.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.d.ts +2 -2
- package/out/resources/whosonfirst/placetypes/graph.js +1 -1
- package/out/resources/whosonfirst/placetypes/specificity.d.ts +2 -2
- package/out/resources/whosonfirst/placetypes/specificity.js +2 -2
- package/out/scripting/utils.d.ts +1 -1
- package/out/scripting/utils.js +1 -1
- package/out/tokenization/normalizer.js +1 -1
- package/out/tools/coarse-placer/outlier-rows.js +1 -1
- package/out/tools/coarse-placer/paths.d.ts +2 -2
- package/out/tools/coarse-placer/paths.js +2 -2
- package/out/trust-policies.d.ts +1 -1
- package/out/trust-policies.js +1 -1
- package/out/types/classifier.d.ts +1 -1
- package/out/utils/chunk-process.d.ts +1 -1
- package/out/utils/chunk-process.js +1 -1
- package/out/utils/system.d.ts +1 -1
- package/out/utils/system.js +1 -1
- package/package.json +28 -8
- package/tools/coarse-placer/outlier-rows.ts +1 -1
- package/tools/coarse-placer/paths.ts +2 -2
package/lib/pipeline.ts
CHANGED
|
@@ -11,6 +11,7 @@ export {
|
|
|
11
11
|
HARD_PLACE_COUNTRY_SAFELIST,
|
|
12
12
|
hardCountryFor,
|
|
13
13
|
STREET_CONTEXT_POSITIVE_SCALE,
|
|
14
|
+
NUMBERED_MORPHOLOGY_OPTS,
|
|
14
15
|
streetContextRequirementFor,
|
|
15
16
|
ZEROED_MORPHOLOGY_OPTS,
|
|
16
17
|
isBareLocalityTree,
|
|
@@ -45,6 +46,8 @@ export type {
|
|
|
45
46
|
AddressClassifier,
|
|
46
47
|
CaseNormalization,
|
|
47
48
|
ClassifierOpts,
|
|
49
|
+
AnchorRegionAncestor,
|
|
50
|
+
AnchorRegionLookupLike,
|
|
48
51
|
FSTMatcherLike,
|
|
49
52
|
InputMode,
|
|
50
53
|
InputModeSelection,
|
|
@@ -68,6 +71,9 @@ export type {
|
|
|
68
71
|
RuntimePipelineStages,
|
|
69
72
|
StageSource,
|
|
70
73
|
UserLocation,
|
|
74
|
+
VenueHeadLexiconLike,
|
|
75
|
+
VenueHeadPriorOpts,
|
|
76
|
+
VenueHeadStage,
|
|
71
77
|
WordConsistencyOpts,
|
|
72
78
|
WordConsistencySetting,
|
|
73
79
|
} from "#pipeline/types"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The file names of PFX1 postcode-prefix indexes. The data root holds one dated file per build
|
|
7
|
+
* under `postcode-prefix/`, and a weights package ships the newest of each scope under the
|
|
8
|
+
* scope's own name. The loaders, the dev overlay linker and the release copy read the same
|
|
9
|
+
* listing here so they agree on which file a scope resolves to.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { PathBuilder, type PathBuilderLike } from "path-ts"
|
|
13
|
+
import { Globerator } from "spliterator/node/fs"
|
|
14
|
+
|
|
15
|
+
import { dataRootPath } from "#data-root"
|
|
16
|
+
import { tryStat } from "#fs/readers/stat"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The data-root directory that holds the dated PFX1 postcode-prefix indexes.
|
|
20
|
+
*/
|
|
21
|
+
export const POSTCODE_PREFIX_DIRECTORY = dataRootPath("postcode-prefix")
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The glob that matches a postcode-prefix index file, dated or shipped.
|
|
25
|
+
*/
|
|
26
|
+
export const POSTCODE_PREFIX_FILE_GLOB = "postcode-prefix-*.bin"
|
|
27
|
+
|
|
28
|
+
const DATED_FILE = /^postcode-prefix-(?<scope>.+)-(?<date>\d{4}-\d{2}-\d{2})\.bin$/
|
|
29
|
+
const SHIPPED_FILE = /^postcode-prefix-(?<scope>.+)\.bin$/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns the file name a weights package ships a scope's index under, such as `postcode-prefix-us.bin`.
|
|
33
|
+
*/
|
|
34
|
+
export function shippedPostcodePrefixName(scope: string): string {
|
|
35
|
+
return `postcode-prefix-${scope}.bin`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns the scope a postcode-prefix file name belongs to, such as `gb-esw`
|
|
40
|
+
* for `postcode-prefix-gb-esw-2026-08-05.bin` or `postcode-prefix-gb-esw.bin`,
|
|
41
|
+
* or `null` for a name of another shape.
|
|
42
|
+
*/
|
|
43
|
+
export function postcodePrefixScopeOf(fileName: string): string | null {
|
|
44
|
+
return DATED_FILE.exec(fileName)?.groups?.scope ?? SHIPPED_FILE.exec(fileName)?.groups?.scope ?? null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* One postcode-prefix index file chosen for its scope.
|
|
49
|
+
*/
|
|
50
|
+
export interface PostcodePrefixFile {
|
|
51
|
+
scope: string
|
|
52
|
+
path: PathBuilder
|
|
53
|
+
mtimeMs: number
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Lists the newest postcode-prefix index of each scope under `directory`, by modification time.
|
|
58
|
+
*
|
|
59
|
+
* An absent directory lists no file.
|
|
60
|
+
* A file whose name has no scope is skipped.
|
|
61
|
+
*/
|
|
62
|
+
export async function newestPostcodePrefixFiles(
|
|
63
|
+
directory: PathBuilderLike = POSTCODE_PREFIX_DIRECTORY
|
|
64
|
+
): Promise<Map<string, PostcodePrefixFile>> {
|
|
65
|
+
const newest = new Map<string, PostcodePrefixFile>()
|
|
66
|
+
|
|
67
|
+
if (!(await tryStat(directory))) return newest
|
|
68
|
+
|
|
69
|
+
for await (const entry of Globerator.from(POSTCODE_PREFIX_FILE_GLOB, { cwd: directory.toString() })) {
|
|
70
|
+
const scope = postcodePrefixScopeOf(entry)
|
|
71
|
+
|
|
72
|
+
if (!scope) continue
|
|
73
|
+
|
|
74
|
+
const path = PathBuilder.from(directory, entry)
|
|
75
|
+
const stat = await tryStat(path)
|
|
76
|
+
|
|
77
|
+
if (!stat) continue
|
|
78
|
+
|
|
79
|
+
const current = newest.get(scope)
|
|
80
|
+
|
|
81
|
+
if (!current || stat.mtimeMs > current.mtimeMs) {
|
|
82
|
+
newest.set(scope, { scope, path, mtimeMs: stat.mtimeMs })
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return newest
|
|
87
|
+
}
|
package/lib/promises.ts
CHANGED
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Marks a promise started ahead of the await that reads it as handled, and returns it unchanged.
|
|
10
|
+
*
|
|
11
|
+
* A rejection still reaches the later await.
|
|
12
|
+
* Before that await, or when the result goes unused, it is not reported as unhandled.
|
|
13
|
+
*/
|
|
14
|
+
export function startEarly<T>(promise: Promise<T>): Promise<T> {
|
|
15
|
+
promise.catch(() => {})
|
|
16
|
+
|
|
17
|
+
return promise
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
/**
|
|
9
21
|
* Await every enumerable own property of an object while preserving its keys.
|
|
10
22
|
*/
|
package/lib/release-config.ts
CHANGED
|
@@ -48,6 +48,13 @@ export interface SoftFeedRecipe {
|
|
|
48
48
|
localitySurfaceLexicon?: string
|
|
49
49
|
pairIndexByCountry?: Record<string, PairIndexInputs>
|
|
50
50
|
postcodeDBByCountry?: Record<string, string>
|
|
51
|
+
/**
|
|
52
|
+
* The PFX1 postcode-prefix index scopes each country ships, such as `["gb-esw"]` for `gb`.
|
|
53
|
+
*
|
|
54
|
+
* The copy takes the newest dated file of each scope under the data root's
|
|
55
|
+
* `postcode-prefix` directory and refuses one whose header tier is `build-local`.
|
|
56
|
+
*/
|
|
57
|
+
postcodePrefixByCountry?: Record<string, string[]>
|
|
51
58
|
[key: string]: unknown
|
|
52
59
|
}
|
|
53
60
|
|
|
@@ -27,7 +27,7 @@ export interface CountryCoverageFact {
|
|
|
27
27
|
country: string
|
|
28
28
|
/**
|
|
29
29
|
* The promotion-eval verdict that hard-filtering this country is a pure win.
|
|
30
|
-
* A hard-filter miss is almost always a
|
|
30
|
+
* A hard-filter miss is almost always a true non-match.
|
|
31
31
|
*
|
|
32
32
|
* Stored as a verdict rather than re-derived from `hardResolveRate` at read time,
|
|
33
33
|
* since it is a judgment over a panel.
|
|
@@ -73,8 +73,8 @@ export interface CountryBBoxFact {
|
|
|
73
73
|
* Facts a loaded gazetteer artifact declares about itself.
|
|
74
74
|
*
|
|
75
75
|
* Read from the artifact's own manifest tables at open time, stored on the
|
|
76
|
-
* {@link ResolverBackend}/{@link Resolver} handle so consumers read the facts
|
|
77
|
-
* the artifact they
|
|
76
|
+
* {@link ResolverBackend}/{@link Resolver} handle so consumers read the facts
|
|
77
|
+
* from the artifact they resolve against.
|
|
78
78
|
*
|
|
79
79
|
* `null` on the handle means the artifact predates the manifest.
|
|
80
80
|
* Consumers then use the code constants.
|
|
@@ -70,7 +70,7 @@ export interface AddressPointLookup {
|
|
|
70
70
|
* Optional bbox scope (`minLat`/`maxLat`/`minLon`/`maxLon`), tried after postcode and locality.
|
|
71
71
|
*
|
|
72
72
|
* For extracts whose points contain no postcode or locality of their own
|
|
73
|
-
* (
|
|
73
|
+
* (some OSM addr nodes do not) but include a coordinate, the resolved locality's
|
|
74
74
|
* bounding box scopes the `(street, number)` probe instead.
|
|
75
75
|
* US situs never passes it, so the Latin path stays byte-stable.
|
|
76
76
|
*/
|
|
@@ -80,7 +80,7 @@ export interface AddressPointLookup {
|
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* One interpolated coordinate estimate, never an exact situs point.
|
|
83
|
-
* `uncertaintyM`
|
|
83
|
+
* `uncertaintyM` states the estimate's radius in meters.
|
|
84
84
|
*
|
|
85
85
|
* A structural mirror of `InterpolatedHit` in `resolver-wof-sqlite/interpolation.ts`.
|
|
86
86
|
* Keep this a subset of that shape so the concrete `StreetInterpolator`
|
|
@@ -107,7 +107,7 @@ export interface InterpolatedPointHit {
|
|
|
107
107
|
*/
|
|
108
108
|
bracket: "both" | "single" | null
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
110
|
+
* Uncertainty radius in meters, measured as half the matched segment length.
|
|
111
111
|
*/
|
|
112
112
|
uncertaintyM: number
|
|
113
113
|
source: string
|
|
@@ -159,20 +159,21 @@ export interface InterpolationLookup {
|
|
|
159
159
|
* One street-centroid hit, the street-level tier below the exact address-point tier
|
|
160
160
|
* and above admin-centroid resolution.
|
|
161
161
|
*
|
|
162
|
-
* A street's centroid and
|
|
162
|
+
* A street's centroid and a radius derived from the street's extent,
|
|
163
|
+
* for a street-only query with no house number.
|
|
163
164
|
* An address-point tier cannot serve that query.
|
|
164
165
|
*
|
|
165
166
|
* Derived from a national register's rooftop points in `street-centroids-<cc>.db`,
|
|
166
167
|
* a `group BY street` roll-up.
|
|
167
168
|
*
|
|
168
|
-
* `uncertaintyM`
|
|
169
|
+
* `uncertaintyM` states the coarseness in meters as half the street's bbox diagonal,
|
|
169
170
|
* so a consumer never mistakes it for a rooftop.
|
|
170
171
|
*/
|
|
171
172
|
export interface StreetCentroidHit {
|
|
172
173
|
lat: number
|
|
173
174
|
lon: number
|
|
174
175
|
/**
|
|
175
|
-
*
|
|
176
|
+
* Coarse radius in meters, measured as half the street's bounding-box diagonal.
|
|
176
177
|
*/
|
|
177
178
|
uncertaintyM: number
|
|
178
179
|
source: string
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* Population divisor in {@link referentialFromPopulation}.
|
|
26
26
|
*
|
|
27
27
|
* A 1,000-person place scores `log2(2)/14` — the curve starts counting at the scale
|
|
28
|
-
* where WOF
|
|
28
|
+
* where WOF records a population value.
|
|
29
29
|
*/
|
|
30
30
|
export const REFERENTIAL_POPULATION_DIVISOR = 1000
|
|
31
31
|
|
package/lib/resolver/types.ts
CHANGED
|
@@ -92,6 +92,11 @@ export interface ResolvedPlace {
|
|
|
92
92
|
* Optional marker for variant-alias exemption.
|
|
93
93
|
*/
|
|
94
94
|
variantAliasExempted?: true | null
|
|
95
|
+
/**
|
|
96
|
+
* Optional stored extent.
|
|
97
|
+
* A point-only row stores its coordinate as both corners.
|
|
98
|
+
*/
|
|
99
|
+
bbox?: { minLat: number; maxLat: number; minLon: number; maxLon: number } | null
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
/**
|
|
@@ -535,6 +540,7 @@ export interface ResolveNodeTrace {
|
|
|
535
540
|
| "ranked"
|
|
536
541
|
| "bare_country"
|
|
537
542
|
| "bare_region"
|
|
543
|
+
| "bare_sublocality"
|
|
538
544
|
| "postcode_prefix"
|
|
539
545
|
| "postcode_format_probe"
|
|
540
546
|
| "empty_admin"
|
|
@@ -3,16 +3,64 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The language vocabulary libpostal's dictionaries are keyed by.
|
|
6
|
+
* The language vocabulary libpostal's dictionaries are keyed by, and the readers for their lines.
|
|
7
7
|
*
|
|
8
|
-
* The dictionaries are build input
|
|
8
|
+
* The dictionaries are mostly build input: the corpus street-decompose adapters read
|
|
9
9
|
* them. `gazetteer-pipeline/{fst,street-morphology,evidence-lexicons}` compile them into the
|
|
10
|
-
* artifacts the parser loads at runtime.
|
|
10
|
+
* artifacts the parser loads at runtime. The POI category lookup reads one language's stopwords
|
|
11
|
+
* at session start.
|
|
11
12
|
*/
|
|
12
13
|
|
|
14
|
+
import { TextSpliterator } from "spliterator"
|
|
15
|
+
|
|
16
|
+
import { readLocalTextFile } from "#fs/readers"
|
|
17
|
+
import { pathExists } from "#fs/readers/stat"
|
|
18
|
+
import { resourceDictionaryPathBuilder } from "#paths"
|
|
13
19
|
import type { Alpha2LanguageCode } from "#resources/languages/types.gen"
|
|
14
20
|
|
|
15
21
|
/**
|
|
16
22
|
* A libpostal dictionary language, or `all` for the language-agnostic directory.
|
|
17
23
|
*/
|
|
18
24
|
export type LibPostalLanguageCode = Alpha2LanguageCode | "all"
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The surfaces of one dictionary line.
|
|
28
|
+
* A line reads `canonical|variant|variant…`.
|
|
29
|
+
*/
|
|
30
|
+
export function libpostalLineSurfaces(line: string): string[] {
|
|
31
|
+
return TextSpliterator.from(line, { delimiter: "|" }).toArray()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Single-word stopwords a language's libpostal `stopwords.txt` omits, keyed by language.
|
|
36
|
+
*
|
|
37
|
+
* English lists `a` and `the` and omits `an`.
|
|
38
|
+
*/
|
|
39
|
+
export const LIBPOSTAL_STOPWORD_SUPPLEMENT: Readonly<Record<string, readonly string[]>> = {
|
|
40
|
+
en: ["an"],
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The lowercased single-word stopwords libpostal lists for `language`, such as `the`
|
|
45
|
+
* and `a` in English or `la` and `des` in French, with {@link LIBPOSTAL_STOPWORD_SUPPLEMENT}.
|
|
46
|
+
*
|
|
47
|
+
* A language libpostal has no stopword file for returns only its supplement.
|
|
48
|
+
*/
|
|
49
|
+
export async function readLibPostalSingleWordStopwords(language: string): Promise<ReadonlySet<string>> {
|
|
50
|
+
const path = resourceDictionaryPathBuilder("libpostal", language, "stopwords.txt")
|
|
51
|
+
const words = new Set<string>(LIBPOSTAL_STOPWORD_SUPPLEMENT[language])
|
|
52
|
+
|
|
53
|
+
if (!(await pathExists(path))) return words
|
|
54
|
+
|
|
55
|
+
for (const line of TextSpliterator.from(await readLocalTextFile(path))) {
|
|
56
|
+
for (const surface of libpostalLineSurfaces(line)) {
|
|
57
|
+
const word = surface.trim().toLocaleLowerCase(language)
|
|
58
|
+
|
|
59
|
+
if (word && !/\s/u.test(word)) {
|
|
60
|
+
words.add(word)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return words
|
|
66
|
+
}
|
|
@@ -37,7 +37,7 @@ export interface PlacetypeGraphLink {
|
|
|
37
37
|
*
|
|
38
38
|
* Each node and each (parent, child) edge appears exactly once.
|
|
39
39
|
* See {@linkcode generatePlacetypeGraph} for why this is the preferred shape
|
|
40
|
-
* when the root has
|
|
40
|
+
* when the root has descendants shared by several branches (e.g. `planet`).
|
|
41
41
|
*/
|
|
42
42
|
export interface PlacetypeGraph {
|
|
43
43
|
root: string
|
|
@@ -51,7 +51,7 @@ export interface PlacetypeGraph {
|
|
|
51
51
|
* Unlike {@linkcode generatePlacetypeTree}, this emits each node and each (parent, child) edge exactly once.
|
|
52
52
|
* WOF placetypes form a DAG with heavy descendant sharing.
|
|
53
53
|
*
|
|
54
|
-
* For example, `installation` is a leaf reachable from
|
|
54
|
+
* For example, `installation` is a leaf reachable from more than one parent.
|
|
55
55
|
* A nested tree duplicates every shared subtree under every parent path in that DAG
|
|
56
56
|
* and blows up exponentially for roots like `planet` (~165 MB for the full hierarchy).
|
|
57
57
|
*
|
|
@@ -88,8 +88,8 @@ export function isAtLeastAsSpecific(
|
|
|
88
88
|
* A check for whether a live row covers a dead one wants an equal rung to count as covering,
|
|
89
89
|
* so a live `locality` covers a dead `locality` of the same name.
|
|
90
90
|
*
|
|
91
|
-
* `isAtLeastAsSpecific(live, dead) === false` answers whether the live row is
|
|
92
|
-
*
|
|
91
|
+
* `isAtLeastAsSpecific(live, dead) === false` answers whether the live row is strictly coarser.
|
|
92
|
+
* That reading drops the equal case without reporting it.
|
|
93
93
|
*
|
|
94
94
|
* `undefined` when either placetype is unranked.
|
|
95
95
|
* A caller filtering on this should treat that as not strictly finer.
|
package/lib/scripting/utils.ts
CHANGED
|
@@ -39,7 +39,7 @@ export function logScriptError(error: unknown): void {
|
|
|
39
39
|
export type ScriptCallback = (...args: unknown[]) => unknown | Promise<unknown>
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Cleans up services and exits the script
|
|
42
|
+
* Cleans up services and exits the script.
|
|
43
43
|
*
|
|
44
44
|
* @param exitCode - Explicit exit code.
|
|
45
45
|
* When omitted, the `process.exitCode` the script set stands, or `0` when it set none.
|
|
@@ -11,7 +11,7 @@ import regenerate from "regenerate"
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* A pattern matching combining diacritical marks, variation selectors and other
|
|
14
|
-
* characters that
|
|
14
|
+
* characters that text normalization commonly targets.
|
|
15
15
|
*/
|
|
16
16
|
const CombiningDiacriticalPattern = regenerate()
|
|
17
17
|
.add(0x20_0d) // zero WIDTH JOINER (U+200D)
|
package/lib/trust-policies.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* keep this module A leaf. The Node build constructs its jsdom window at import time — measured at
|
|
18
18
|
* 0.45 s and ~130 MB over a bare Node process — so an import from a barrel (`core/utils`, the CLI
|
|
19
|
-
* graph) would
|
|
19
|
+
* graph) would add that time and memory to every process in the repo. Only modules that sanitize import it.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import DOMPurify, { type Config as DOMPurifyConfig } from "isomorphic-dompurify"
|
package/lib/types/classifier.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type Section = Span
|
|
|
36
36
|
export type ClassificationProposalSource = "neural" | "merged"
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* A typed classification candidate
|
|
39
|
+
* A classifier produces this typed classification candidate.
|
|
40
40
|
*
|
|
41
41
|
* `source` and `source_id` identify the origin of each proposal without external state.
|
|
42
42
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* The function reads only the last stdout line, so a child can print diagnostics before its result.
|
|
14
14
|
*
|
|
15
15
|
* A non-zero exit throws.
|
|
16
|
-
* A chunk that exits
|
|
16
|
+
* A chunk that exits with code 0 without rows also throws.
|
|
17
17
|
* A chunk that dies mid-range has already written part of its rows into the shared artifact.
|
|
18
18
|
* The parent process must stop before it seals a database
|
|
19
19
|
* missing rows without identifiers.
|
package/lib/utils/system.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { arch, availableParallelism as nativeAvailableParallelism, cpus, platfor
|
|
|
11
11
|
import { getHeapStatistics } from "node:v8"
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The number of threads that can run at once, as the runtime measures it — the ceiling for a worker pool.
|
|
15
15
|
*/
|
|
16
16
|
export function availableParallelism(): number {
|
|
17
17
|
return nativeAvailableParallelism()
|
package/out/api/APIClient.d.ts
CHANGED
|
@@ -32,11 +32,11 @@ export interface APIClientConfig {
|
|
|
32
32
|
*/
|
|
33
33
|
disposeCacheStorage?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* The number of requests to make per minute before enforcing a cooldown: a budget model —
|
|
36
36
|
* spend `requestsPerMinute` dispatches, then stall until the cooldown lapses.
|
|
37
37
|
*
|
|
38
38
|
* This cannot express a flat per-second rate.
|
|
39
|
-
*
|
|
39
|
+
* Some fair-access policies publish that limit.
|
|
40
40
|
* Use {@linkcode minRequestIntervalMs} for that.
|
|
41
41
|
*
|
|
42
42
|
* The two compose (both limits must clear) but you almost certainly want one.
|
package/out/api/APIClient.js
CHANGED
|
@@ -51,7 +51,7 @@ export class APIClient extends EventTarget {
|
|
|
51
51
|
this.#pacer = config.minRequestIntervalMs ? new RequestPacer(config.minRequestIntervalMs, this.#clock) : null;
|
|
52
52
|
// The pacing limit lives IN the adapter rather than in `fetch()`: `axios-cache-interceptor`
|
|
53
53
|
// short-circuits a cache HIT by replacing `config.adapter` with its own `cachedAdapter`,
|
|
54
|
-
// so anything installed here is reached only when the request is
|
|
54
|
+
// so anything installed here is reached only when the request is going to the network.
|
|
55
55
|
// A check in `fetch()` would run after the cache interceptor and make every
|
|
56
56
|
// cache hit burn a full pacer sleep.
|
|
57
57
|
//
|
package/out/api/APIClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIClient.js","sourceRoot":"","sources":["../../lib/api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,EAA6F,MAAM,OAAO,CAAA;AACxH,OAAO,EAIN,UAAU,GACV,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAkB,WAAW,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EACN,oBAAoB,EAEpB,kBAAkB,EAClB,YAAY,GAEZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,aAAa,EAAuB,MAAM,UAAU,CAAA;AAE7D,MAAM,aAAa,GAAG,MAAM,CAAA;AAwE5B;;;;GAIG;AACH,MAAM,OAAO,SAAuD,SAAQ,WAAW;IACtE,MAAM,CAAG;IAEzB,sBAAsB,GAAsC,I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QACvB,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,aAAa,CAAA;IAC/C,CAAC;CACD"}
|
package/out/api/ckan.d.ts
CHANGED
package/out/api/clock.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The pacing and backoff suites inject the clock so they stay deterministic and finish in
|
|
8
8
|
* milliseconds instead of sleeping on the wall clock.
|
|
9
|
-
* clock — a rate-limit test that
|
|
9
|
+
* clock — a rate-limit test that waits in real time 100ms per grant costs 4s for a 40-call fan-out and
|
|
10
10
|
* is flaky under CI load. the same test against an injected clock is exact and instant.
|
|
11
11
|
*
|
|
12
12
|
* Deliberately not `node:timers/promises`: `core/api` reaches a browser bundle (`docs`'s
|
package/out/api/clock.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The pacing and backoff suites inject the clock so they stay deterministic and finish in
|
|
8
8
|
* milliseconds instead of sleeping on the wall clock.
|
|
9
|
-
* clock — a rate-limit test that
|
|
9
|
+
* clock — a rate-limit test that waits in real time 100ms per grant costs 4s for a 40-call fan-out and
|
|
10
10
|
* is flaky under CI load. the same test against an injected clock is exact and instant.
|
|
11
11
|
*
|
|
12
12
|
* Deliberately not `node:timers/promises`: `core/api` reaches a browser bundle (`docs`'s
|
package/out/api/disk-storage.js
CHANGED
|
@@ -29,9 +29,9 @@ import { sha256Hex } from "#hash";
|
|
|
29
29
|
import { tryParsingJSON, stringifyJSON } from "#json";
|
|
30
30
|
import { ConsoleLogger } from "#logging";
|
|
31
31
|
/**
|
|
32
|
-
* Whether a storage value is
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* Whether a storage value is persisted to disk: `loading` is an in-flight marker with no reusable body,
|
|
33
|
+
* so it belongs in the in-process overlay (see {@linkcode buildDiskStorage}) rather than in a
|
|
34
|
+
* file that would outlive the process that wrote it and block every later request for that key.
|
|
35
35
|
*/
|
|
36
36
|
function isPersistableState(value) {
|
|
37
37
|
return value.state !== "loading";
|
|
@@ -139,7 +139,7 @@ export function buildDiskStorage(options) {
|
|
|
139
139
|
}
|
|
140
140
|
const serialized = serializeIfValid(key, value);
|
|
141
141
|
if (!serialized) {
|
|
142
|
-
// Drop any older entry too: the interceptor is telling us this key's content
|
|
142
|
+
// Drop any older entry too: the interceptor is telling us this key's content changed.
|
|
143
143
|
// A superseded body would turn this changed response into a stale cache hit.
|
|
144
144
|
await removeEntry(key);
|
|
145
145
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disk-storage.js","sourceRoot":"","sources":["../../lib/api/disk-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAqB,YAAY,EAAgD,MAAM,yBAAyB,CAAA;AACvH,OAAO,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAAE,aAAa,EAAuB,MAAM,UAAU,CAAA;AA+B7D;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,KAA2B;IACtD,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,CAAA;AACjC,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,eAAe,CAAC,KAA2B;IACnD,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAA;IAEpF,OAAO,KAAK,CAAC,GAAG,KAAK,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ACJ,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;gBAChC,MAAM,cAAc,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;gBAC9C,MAAM,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;YACxC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,gGAAgG;gBAChG,8EAA8E;gBAC9E,kFAAkF;gBAClF,6EAA6E;gBAC7E,yEAAyE;gBACzE,mDAAmD;gBACnD,oCAAoC;gBACpC,2CAA2C;gBAC3C,MAAM,CAAC,IAAI,CAAC,qBAAqB,GAAG,kCAAkC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;gBAE5F,kFAAkF;gBAClF,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;YACtD,CAAC;oBAAS,CAAC;gBACV,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACpB,CAAC;QACF,CAAC;QAED,MAAM,EAAE,WAAW;QAEnB,KAAK,EAAE,KAAK,IAAI,EAAE;YACjB,OAAO,CAAC,KAAK,EAAE,CAAA;YAEf,qEAAqE;YACrE,oFAAoF;YACpF,wCAAwC;YACxC,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAA;YACpC,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;QACjC,CAAC;KACD,CAAC,CAAA;AACH,CAAC"}
|
package/out/api/ogc.d.ts
CHANGED
|
@@ -74,16 +74,16 @@ export interface OGCFeature<Properties = Record<string, unknown>> {
|
|
|
74
74
|
/**
|
|
75
75
|
* A reader answering an OGC API Features bbox query around a point.
|
|
76
76
|
*
|
|
77
|
-
* The service answers a bbox rather than a point, so this returns what it
|
|
78
|
-
* and the containment decision belongs to the caller,
|
|
79
|
-
* comparing a verdict against a bare "the service returned
|
|
80
|
-
* pass on any polygon within the probe's width.
|
|
77
|
+
* The service answers a bbox rather than a point, so this returns what it
|
|
78
|
+
* published inside that bbox and the containment decision belongs to the caller,
|
|
79
|
+
* against the returned rings — comparing a verdict against a bare "the service returned
|
|
80
|
+
* something here" would pass on any polygon within the probe's width.
|
|
81
81
|
*/
|
|
82
82
|
export declare function createOGCFeaturesBBoxReader<Feature>(options: CreateOGCFeaturesBBoxReaderOptions): (latitude: number, longitude: number) => Promise<Feature[]>;
|
|
83
83
|
/**
|
|
84
84
|
* The extent an OGC API Features collection declares, in CRS84 order.
|
|
85
85
|
*
|
|
86
|
-
* @param options.subject
|
|
86
|
+
* @param options.subject Identifies the collection in the refusal, where the caller reads more than one.
|
|
87
87
|
*/
|
|
88
88
|
export declare function readOGCCollectionBBox(client: Pick<APIClient, "fetch">, options: {
|
|
89
89
|
collectionURL: string;
|
|
@@ -112,11 +112,11 @@ export interface ReadWFSFeatureCountOptions {
|
|
|
112
112
|
* {@linkcode readCheckedWFSFeatureCount} instead.
|
|
113
113
|
* That reader asks a second time.
|
|
114
114
|
*
|
|
115
|
-
* @param options.subject
|
|
115
|
+
* @param options.subject Identifies the layer in the refusal, where the caller reads more than one.
|
|
116
116
|
*/
|
|
117
117
|
export declare function readWFSFeatureCount(client: Pick<APIClient, "fetch">, options: ReadWFSFeatureCountOptions): Promise<number>;
|
|
118
118
|
/**
|
|
119
|
-
* How
|
|
119
|
+
* How far a service's own feature count can be trusted.
|
|
120
120
|
*
|
|
121
121
|
* `reported` is the number the service stated, and `usable` records whether a second read agreed with it.
|
|
122
122
|
* A caller records the count only where `usable` is true and records `because` otherwise,
|
|
@@ -152,7 +152,7 @@ export interface CheckedWFSFeatureCount {
|
|
|
152
152
|
* so a caller that needs the number retries, through `APIClient`'s `retry` configuration
|
|
153
153
|
* or by reading the `numberMatched` a feature page holds.
|
|
154
154
|
*
|
|
155
|
-
* @param options.subject
|
|
155
|
+
* @param options.subject Identifies the layer in the reason, where the caller reads more than one.
|
|
156
156
|
*/
|
|
157
157
|
export declare function readCheckedWFSFeatureCount(client: Pick<APIClient, "fetch">, options: ReadWFSFeatureCountOptions & {
|
|
158
158
|
probeSize?: number;
|