@mailwoman/core 4.16.2 → 5.1.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/chromium-i18n/ssl-address-download.ts +110 -0
- package/data/libpostal/resources-download.ts +121 -0
- package/out/api/APIClient.d.ts +2 -2
- package/out/api/APIClient.d.ts.map +1 -1
- package/out/api/APIClient.js +2 -2
- package/out/api/APIClient.js.map +1 -1
- package/out/api/responses.d.ts.map +1 -1
- package/out/api/responses.js.map +1 -1
- package/out/classification/Classification.d.ts +3 -4
- package/out/classification/Classification.d.ts.map +1 -1
- package/out/classification/Classification.js.map +1 -1
- package/out/classification/CompositeClassifier.d.ts +1 -1
- package/out/classification/CompositeClassifier.d.ts.map +1 -1
- package/out/classification/CompositeClassifier.js +1 -1
- package/out/classification/CompositeClassifier.js.map +1 -1
- package/out/classification/PhraseClassifier.d.ts.map +1 -1
- package/out/classification/PhraseClassifier.js.map +1 -1
- package/out/classification/SectionClassifier.d.ts.map +1 -1
- package/out/classification/SectionClassifier.js.map +1 -1
- package/out/classification/WordClassifier.d.ts.map +1 -1
- package/out/classification/WordClassifier.js.map +1 -1
- package/out/classification/scheme.d.ts.map +1 -1
- package/out/classification/scheme.js.map +1 -1
- package/out/coarse-placer/coarse-placer.d.ts +28 -34
- package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
- package/out/coarse-placer/coarse-placer.js +19 -21
- package/out/coarse-placer/coarse-placer.js.map +1 -1
- package/out/coarse-placer/featurize.d.ts +17 -19
- package/out/coarse-placer/featurize.d.ts.map +1 -1
- package/out/coarse-placer/featurize.js +17 -19
- package/out/coarse-placer/featurize.js.map +1 -1
- package/out/collections.d.ts +1 -2
- package/out/collections.d.ts.map +1 -1
- package/out/collections.js +1 -2
- package/out/collections.js.map +1 -1
- package/out/data/chromium-i18n/ssl-address-download.d.ts +30 -0
- package/out/data/chromium-i18n/ssl-address-download.d.ts.map +1 -0
- package/out/data/chromium-i18n/ssl-address-download.js +98 -0
- package/out/data/chromium-i18n/ssl-address-download.js.map +1 -0
- package/out/data/libpostal/resources-download.d.ts +29 -0
- package/out/data/libpostal/resources-download.d.ts.map +1 -0
- package/out/data/libpostal/resources-download.js +107 -0
- package/out/data/libpostal/resources-download.js.map +1 -0
- package/out/db/schema.d.ts +2 -2
- package/out/decoder/arbitrate-tree.d.ts +3 -3
- package/out/decoder/arbitrate-tree.d.ts.map +1 -1
- package/out/decoder/arbitrate-tree.js +5 -5
- package/out/decoder/arbitrate-tree.js.map +1 -1
- package/out/decoder/build-tree.d.ts +12 -14
- package/out/decoder/build-tree.d.ts.map +1 -1
- package/out/decoder/build-tree.js +4 -5
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/calibration.d.ts +3 -4
- package/out/decoder/calibration.d.ts.map +1 -1
- package/out/decoder/calibration.js +3 -4
- package/out/decoder/calibration.js.map +1 -1
- package/out/decoder/containment.d.ts +5 -6
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js +5 -6
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/index.d.ts +1 -0
- package/out/decoder/index.d.ts.map +1 -1
- package/out/decoder/index.js +1 -0
- package/out/decoder/index.js.map +1 -1
- package/out/decoder/proposals-to-tree.d.ts +9 -9
- package/out/decoder/proposals-to-tree.d.ts.map +1 -1
- package/out/decoder/proposals-to-tree.js +11 -11
- package/out/decoder/proposals-to-tree.js.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.d.ts +3 -5
- package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.js +5 -6
- package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
- package/out/decoder/serialize-json.d.ts +13 -1
- package/out/decoder/serialize-json.d.ts.map +1 -1
- package/out/decoder/serialize-json.js +6 -2
- package/out/decoder/serialize-json.js.map +1 -1
- package/out/decoder/serialize-tuples.d.ts +10 -1
- package/out/decoder/serialize-tuples.d.ts.map +1 -1
- package/out/decoder/serialize-tuples.js +13 -5
- package/out/decoder/serialize-tuples.js.map +1 -1
- package/out/decoder/serialize-xml.d.ts +15 -9
- package/out/decoder/serialize-xml.d.ts.map +1 -1
- package/out/decoder/serialize-xml.js +29 -12
- package/out/decoder/serialize-xml.js.map +1 -1
- package/out/decoder/types.d.ts +52 -61
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +2 -2
- package/out/decoder/unknown-spans.d.ts +46 -0
- package/out/decoder/unknown-spans.d.ts.map +1 -0
- package/out/decoder/unknown-spans.js +56 -0
- package/out/decoder/unknown-spans.js.map +1 -0
- package/out/decoder/validate-tree.d.ts.map +1 -1
- package/out/decoder/validate-tree.js +2 -3
- package/out/decoder/validate-tree.js.map +1 -1
- package/out/env/index.d.ts +80 -0
- package/out/env/index.d.ts.map +1 -0
- package/out/env/index.js +35 -0
- package/out/env/index.js.map +1 -0
- package/out/env/load.d.ts +7 -0
- package/out/env/load.d.ts.map +1 -0
- package/out/env/load.js +13 -0
- package/out/env/load.js.map +1 -0
- package/out/env/paths.d.ts +13 -0
- package/out/env/paths.d.ts.map +1 -0
- package/out/env/paths.js +34 -0
- package/out/env/paths.js.map +1 -0
- package/out/env/schema.d.ts +81 -0
- package/out/env/schema.d.ts.map +1 -0
- package/out/env/schema.js +92 -0
- package/out/env/schema.js.map +1 -0
- package/out/errors/schema.d.ts +1 -2
- package/out/errors/schema.d.ts.map +1 -1
- package/out/errors/schema.js +1 -2
- package/out/errors/schema.js.map +1 -1
- package/out/filters/RelationshipFilter.d.ts.map +1 -1
- package/out/filters/RelationshipFilter.js.map +1 -1
- package/out/formatter/index.d.ts.map +1 -1
- package/out/formatter/index.js.map +1 -1
- package/out/identifiers.d.ts.map +1 -1
- package/out/identifiers.js.map +1 -1
- package/out/kysley/client.d.ts +3 -4
- package/out/kysley/client.d.ts.map +1 -1
- package/out/kysley/client.js +3 -4
- package/out/kysley/client.js.map +1 -1
- package/out/kysley/dialect-config.d.ts +1 -1
- package/out/kysley/dialect-config.d.ts.map +1 -1
- package/out/kysley/dialect.d.ts +4 -4
- package/out/kysley/dialect.js +4 -4
- package/out/kysley/driver.d.ts.map +1 -1
- package/out/kysley/driver.js +1 -1
- package/out/kysley/driver.js.map +1 -1
- package/out/lifecycle/ServiceSymbol.d.ts +2 -4
- package/out/lifecycle/ServiceSymbol.d.ts.map +1 -1
- package/out/lifecycle/ServiceSymbol.js +2 -4
- package/out/lifecycle/ServiceSymbol.js.map +1 -1
- package/out/lifecycle/services.d.ts +7 -8
- package/out/lifecycle/services.d.ts.map +1 -1
- package/out/lifecycle/services.js +5 -4
- package/out/lifecycle/services.js.map +1 -1
- package/out/locale/locale.d.ts +5 -6
- package/out/locale/locale.d.ts.map +1 -1
- package/out/locale/registry.d.ts.map +1 -1
- package/out/locale/registry.js.map +1 -1
- package/out/logging/index.d.ts +1 -0
- package/out/logging/index.d.ts.map +1 -1
- package/out/logging/index.js +1 -0
- package/out/logging/index.js.map +1 -1
- package/out/logging/shared.d.ts +2 -2
- package/out/logging/shared.js +2 -2
- package/out/logging/utils.d.ts +30 -0
- package/out/logging/utils.d.ts.map +1 -0
- package/out/logging/utils.js +30 -0
- package/out/logging/utils.js.map +1 -0
- package/out/objects.d.ts +3 -4
- package/out/objects.d.ts.map +1 -1
- package/out/objects.js +1 -2
- package/out/objects.js.map +1 -1
- package/out/parser/AddressParser.d.ts +12 -16
- package/out/parser/AddressParser.d.ts.map +1 -1
- package/out/parser/AddressParser.js.map +1 -1
- package/out/parser/proposal-pipeline.d.ts +12 -12
- package/out/parser/proposal-pipeline.d.ts.map +1 -1
- package/out/parser/proposal-pipeline.js +12 -12
- package/out/parser/proposal-pipeline.js.map +1 -1
- package/out/parser/solution-to-proposals.d.ts +4 -4
- package/out/parser/solution-to-proposals.d.ts.map +1 -1
- package/out/parser/solution-to-proposals.js +5 -5
- package/out/parser/solution-to-proposals.js.map +1 -1
- package/out/pipeline/index.d.ts +1 -1
- package/out/pipeline/reconcile-lookups.d.ts +4 -4
- package/out/pipeline/reconcile-lookups.d.ts.map +1 -1
- package/out/pipeline/reconcile-lookups.js +4 -4
- package/out/pipeline/reconcile-lookups.js.map +1 -1
- package/out/pipeline/reconcile.d.ts +21 -23
- package/out/pipeline/reconcile.d.ts.map +1 -1
- package/out/pipeline/reconcile.js +49 -51
- package/out/pipeline/reconcile.js.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +14 -16
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +33 -37
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-logit-aggregation.d.ts +5 -6
- package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
- package/out/pipeline/span-logit-aggregation.js +7 -8
- package/out/pipeline/span-logit-aggregation.js.map +1 -1
- package/out/pipeline/span-proposer.d.ts +18 -22
- package/out/pipeline/span-proposer.d.ts.map +1 -1
- package/out/pipeline/span-proposer.js +21 -22
- package/out/pipeline/span-proposer.js.map +1 -1
- package/out/pipeline/types.d.ts +77 -86
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/policy/defaults.d.ts +5 -6
- package/out/policy/defaults.d.ts.map +1 -1
- package/out/policy/defaults.js +5 -6
- package/out/policy/defaults.js.map +1 -1
- package/out/policy/from-config.d.ts +8 -9
- package/out/policy/from-config.d.ts.map +1 -1
- package/out/policy/from-config.js +8 -9
- package/out/policy/from-config.js.map +1 -1
- package/out/policy/input-shape-router.d.ts +15 -19
- package/out/policy/input-shape-router.d.ts.map +1 -1
- package/out/policy/input-shape-router.js +11 -14
- package/out/policy/input-shape-router.js.map +1 -1
- package/out/policy/policy.d.ts +10 -13
- package/out/policy/policy.d.ts.map +1 -1
- package/out/policy/registry.d.ts +4 -5
- package/out/policy/registry.d.ts.map +1 -1
- package/out/policy/registry.js +6 -7
- package/out/policy/registry.js.map +1 -1
- package/out/resolver/index.d.ts +1 -1
- package/out/resolver/index.js +1 -1
- package/out/resolver/types.d.ts +212 -216
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +32 -39
- package/out/resolver/types.js.map +1 -1
- package/out/resources/LocaleIndex.d.ts +1 -2
- package/out/resources/LocaleIndex.d.ts.map +1 -1
- package/out/resources/LocaleIndex.js +1 -2
- package/out/resources/LocaleIndex.js.map +1 -1
- package/out/resources/ResourceMapCache.d.ts.map +1 -1
- package/out/resources/ResourceMapCache.js.map +1 -1
- package/out/resources/collections.d.ts +1 -2
- package/out/resources/collections.d.ts.map +1 -1
- package/out/resources/collections.js +1 -2
- package/out/resources/collections.js.map +1 -1
- package/out/resources/fs.d.ts.map +1 -1
- package/out/resources/fs.js.map +1 -1
- package/out/resources/git.d.ts.map +1 -1
- package/out/resources/git.js.map +1 -1
- package/out/resources/libaddressinput.d.ts +2 -2
- package/out/resources/libaddressinput.js +2 -2
- package/out/resources/libpostal.d.ts +4 -5
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/libpostal.js +6 -7
- package/out/resources/libpostal.js.map +1 -1
- package/out/resources/set.d.ts +1 -2
- package/out/resources/set.d.ts.map +1 -1
- package/out/resources/set.js +1 -2
- package/out/resources/set.js.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
- package/out/resources/whosonfirst/loader.d.ts +1 -2
- package/out/resources/whosonfirst/loader.d.ts.map +1 -1
- package/out/resources/whosonfirst/loader.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts +6 -9
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.js +7 -10
- package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -2
- package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.js +1 -2
- package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.d.ts +10 -10
- package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.js +0 -0
- package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts +16 -19
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js +15 -16
- package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.d.ts +6 -7
- package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.js +3 -4
- package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
- package/out/routing/index.d.ts +2 -3
- package/out/routing/index.d.ts.map +1 -1
- package/out/routing/index.js +1 -1
- package/out/routing/index.js.map +1 -1
- package/out/solver/HashMapSolver.d.ts.map +1 -1
- package/out/solver/HashMapSolver.js.map +1 -1
- package/out/solver/Solution.d.ts +2 -2
- package/out/solver/Solution.d.ts.map +1 -1
- package/out/solver/Solution.js +2 -2
- package/out/solver/Solution.js.map +1 -1
- package/out/solver/mask.d.ts.map +1 -1
- package/out/solver/mask.js.map +1 -1
- package/out/solvers/LeadingAreaDeclassifier.d.ts.map +1 -1
- package/out/solvers/LeadingAreaDeclassifier.js.map +1 -1
- package/out/solvers/MultiStreetSolver.d.ts +10 -15
- package/out/solvers/MultiStreetSolver.d.ts.map +1 -1
- package/out/solvers/MultiStreetSolver.js +10 -15
- package/out/solvers/MultiStreetSolver.js.map +1 -1
- package/out/solvers/PostcodePositionPenalty.d.ts +2 -2
- package/out/solvers/PostcodePositionPenalty.d.ts.map +1 -1
- package/out/solvers/PostcodePositionPenalty.js +2 -2
- package/out/solvers/PostcodePositionPenalty.js.map +1 -1
- package/out/tokenization/Span.d.ts +1 -3
- package/out/tokenization/Span.d.ts.map +1 -1
- package/out/tokenization/Span.js +1 -3
- package/out/tokenization/Span.js.map +1 -1
- package/out/tokenization/context.d.ts +1 -2
- package/out/tokenization/context.d.ts.map +1 -1
- package/out/tokenization/context.js +1 -2
- package/out/tokenization/context.js.map +1 -1
- package/out/tokenization/normalizer.js +2 -2
- package/out/tokenization/permutate.d.ts +2 -3
- package/out/tokenization/permutate.d.ts.map +1 -1
- package/out/tokenization/permutate.js +4 -5
- package/out/tokenization/permutate.js.map +1 -1
- package/out/types/classifier.d.ts +21 -23
- package/out/types/classifier.d.ts.map +1 -1
- package/out/types/component.d.ts +6 -7
- package/out/types/component.d.ts.map +1 -1
- package/out/types/component.js +5 -6
- package/out/types/component.js.map +1 -1
- package/out/types/mapping.d.ts +8 -8
- package/out/types/mapping.d.ts.map +1 -1
- package/out/types/mapping.js +13 -13
- package/out/types/mapping.js.map +1 -1
- package/out/utils/data-root.d.ts +5 -5
- package/out/utils/data-root.js +7 -7
- package/out/utils/repo.d.ts +3 -3
- package/out/utils/repo.d.ts.map +1 -1
- package/out/utils/repo.js +16 -19
- package/out/utils/repo.js.map +1 -1
- package/out/vitest.config.d.ts.map +1 -1
- package/out/vitest.config.js.map +1 -1
- package/package.json +21 -19
- package/data/chromium-i18n/ssl-address-download.sh +0 -15
- package/data/libpostal/resources-download.sh +0 -44
- package/out/logging/tables.d.ts +0 -7
- package/out/logging/tables.d.ts.map +0 -1
- package/out/logging/tables.js +0 -75
- package/out/logging/tables.js.map +0 -1
- package/out/sets.d.ts +0 -2
- package/out/sets.d.ts.map +0 -1
- package/out/sets.js +0 -2
- package/out/sets.js.map +0 -1
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* map") rather than emit a confident mis-placement. Pure + dependency-free — runs in node and the
|
|
10
10
|
* browser.
|
|
11
11
|
*/
|
|
12
|
+
import { $public } from "../env/index.js";
|
|
12
13
|
import { COARSE_CLASSES, FEATURE_DIM, featurize } from "./featurize.js";
|
|
13
14
|
/**
|
|
14
|
-
* Dequantize a per-row int8 weight matrix back to fp32: `W[c][i] = int8[c*dim + i] * scales[c]`.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Dequantize a per-row int8 weight matrix back to fp32: `W[c][i] = int8[c*dim + i] * scales[c]`. The predict path stays
|
|
16
|
+
* fp32 (identical math); quantization only shrinks the serialized/wire artifact. Pure — usable in the browser loader
|
|
17
|
+
* too.
|
|
17
18
|
*/
|
|
18
19
|
export function dequantizeInt8Weights(int8, scales, classCount, dim) {
|
|
19
20
|
const expected = classCount * dim;
|
|
@@ -53,10 +54,10 @@ export class CoarsePlacer {
|
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Load a placer from an artifact directory holding `meta.json` + `weights.bin` (the layout
|
|
56
|
-
* `scripts/coarse-placer/train.mjs` and `quantize.mjs` write). Handles both the fp32 artifact
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* `scripts/coarse-placer/train.mjs` and `quantize.mjs` write). Handles both the fp32 artifact (`weights.bin` is a
|
|
58
|
+
* `Float32Array`) and the int8 artifact (`meta.quantization === "int8-per-row"`, `weights.bin` is an `Int8Array`
|
|
59
|
+
* dequantized via `meta.scales`). Node-only — the `node:` imports are dynamic so bundling the class for the browser
|
|
60
|
+
* doesn't pull them in.
|
|
60
61
|
*/
|
|
61
62
|
static async fromArtifactDir(dir, opts) {
|
|
62
63
|
const { readFile } = await import("node:fs/promises");
|
|
@@ -78,15 +79,14 @@ export class CoarsePlacer {
|
|
|
78
79
|
return new CoarsePlacer({ classes: meta.classes, featureDim: meta.featureDim, temperature: meta.temperature, bias: meta.bias, weights }, opts);
|
|
79
80
|
}
|
|
80
81
|
/**
|
|
81
|
-
* Load the int8 model bundled in `@mailwoman/core` (`core/data/coarse-placer/`). Node-only — uses
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* soft-country-prior wiring passes 0.9 — see
|
|
82
|
+
* Load the int8 model bundled in `@mailwoman/core` (`core/data/coarse-placer/`). Node-only — uses the package path
|
|
83
|
+
* builder (the #481-corrected `__isCompiledTree` makes this resolve to the shipped `data/` in source, compiled, AND
|
|
84
|
+
* installed-package layouts). Override the directory with `$MAILWOMAN_COARSE_PLACER_DIR`. Callers set `abstainBelow`
|
|
85
|
+
* per their use (the soft-country-prior wiring passes 0.9 — see
|
|
86
86
|
* docs/articles/plan/2026-06-14-coarse-placer-soft-signal-spec.md).
|
|
87
87
|
*/
|
|
88
88
|
static async fromBundled(opts) {
|
|
89
|
-
const dir =
|
|
89
|
+
const dir = $public.MAILWOMAN_COARSE_PLACER_DIR;
|
|
90
90
|
if (dir)
|
|
91
91
|
return CoarsePlacer.fromArtifactDir(dir, opts);
|
|
92
92
|
const { corePackagePathBuilder } = await import("../utils/repo.js");
|
|
@@ -159,14 +159,12 @@ export class CoarsePlacer {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
|
-
* The in-map posterior for the soft-prior DISTRIBUTION wiring (#244 residual upgrade): the
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* the in-map mass `1 - P(OTHER)`), matching the one-hot's `confidence` scale so `anchorWeight` is
|
|
169
|
-
* unchanged.
|
|
162
|
+
* The in-map posterior for the soft-prior DISTRIBUTION wiring (#244 residual upgrade): the per-in-map-country marginals
|
|
163
|
+
* (every class except `OTHER`) from a prediction, or `null` when the model abstained / routed off-map. Fed straight to
|
|
164
|
+
* the resolver's `anchorPosterior` so it boosts EVERY plausible in-map country proportionally — and breaks
|
|
165
|
+
* country-ambiguous ties (mass split across several in-map countries) with its own place-level evidence — instead of
|
|
166
|
+
* committing to the single argmax (the one-hot the M2 wiring shipped). Raw marginals (un-renormalized; they sum to the
|
|
167
|
+
* in-map mass `1 - P(OTHER)`), matching the one-hot's `confidence` scale so `anchorWeight` is unchanged.
|
|
170
168
|
*/
|
|
171
169
|
export function inMapPosterior(prediction) {
|
|
172
170
|
if (prediction.country === null || prediction.country === "OTHER")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coarse-placer.js","sourceRoot":"","sources":["../../coarse-placer/coarse-placer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"coarse-placer.js","sourceRoot":"","sources":["../../coarse-placer/coarse-placer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AA4BvE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACpC,IAAe,EACf,MAAyB,EACzB,UAAkB,EAClB,GAAW;IAEX,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG,CAAA;IAEjC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,MAAM,kBAAkB,QAAQ,EAAE,CAAC,CAAA;IAEjH,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,MAAM,CAAC,MAAM,aAAa,UAAU,UAAU,CAAC,CAAA;IAChH,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAA;IAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,CA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AC3F,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,QAAwF,EACxF,OAAqB,EACrB,IAAuB;IAEvB,OAAO,IAAI,YAAY,CAAC,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAA;AACxD,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -15,33 +15,31 @@
|
|
|
15
15
|
* coarsely" tier.
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
|
-
* The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU expansion, and `OTHER` — the
|
|
19
|
+
* explicit off-map class (milestone 2) trained on non-Latin/non-CJK scripts via outlier exposure, so the model learns
|
|
20
|
+
* the edge of its competence and routes "probably off my loaded map" instead of a confident mis-placement. Index order
|
|
21
|
+
* is the label id.
|
|
22
22
|
*
|
|
23
|
-
* The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* its own `classes`, so this constant only drives training (`train.mjs`), not inference.
|
|
23
|
+
* The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the placer previously
|
|
24
|
+
* couldn't emit — ambiguous names there (FI "Helsinki", PL "Rybnik") landed off-continent in the population-first
|
|
25
|
+
* candidate gazetteer because no country prior pinned them. They're trained from the Overture per-country addresses
|
|
26
|
+
* theme (`build-dataset.mjs`), and they're pulled OUT of the Latin off-map OTHER outlier set
|
|
27
|
+
* (`build-outlier-latin.mjs`) that used to teach PL/PT/CZ → OTHER. Widening the class set is the soft-prior lever; it
|
|
28
|
+
* never hard-filters, so a neighbour confusion (DK↔NO, EE↔LT↔LV) still keeps resolution in-region, off the global-pop
|
|
29
|
+
* attractors. Adding a class requires a retrain + a fresh artifact — the bundled meta.json carries its own `classes`,
|
|
30
|
+
* so this constant only drives training (`train.mjs`), not inference.
|
|
32
31
|
*/
|
|
33
32
|
export declare const COARSE_CLASSES: readonly ["US", "FR", "GB", "CN", "NL", "IT", "DE", "JP", "ES", "KR", "TW", "AT", "BE", "CH", "CZ", "DK", "EE", "FI", "HR", "LT", "LU", "LV", "NO", "PL", "PT", "SI", "SK", "OTHER"];
|
|
34
33
|
export type CoarseClass = (typeof COARSE_CLASSES)[number];
|
|
35
34
|
/**
|
|
36
|
-
* Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8)
|
|
37
|
-
*
|
|
38
|
-
* are few.
|
|
35
|
+
* Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8) while collisions stay
|
|
36
|
+
* tolerable for a linear bag-of-features model; the discriminative n-grams are few.
|
|
39
37
|
*/
|
|
40
38
|
export declare const FEATURE_DIM: number;
|
|
41
39
|
/**
|
|
42
|
-
* Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the
|
|
43
|
-
*
|
|
44
|
-
*
|
|
40
|
+
* Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the lowercased,
|
|
41
|
+
* boundary-marked string + one presence token per Unicode script seen (+ the dominant script). Non-Latin characters are
|
|
42
|
+
* PRESERVED (lowercasing only touches cased scripts).
|
|
45
43
|
*/
|
|
46
44
|
export declare function featurize(text: string): number[];
|
|
47
45
|
//# sourceMappingURL=featurize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featurize.d.ts","sourceRoot":"","sources":["../../coarse-placer/featurize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH
|
|
1
|
+
{"version":3,"file":"featurize.d.ts","sourceRoot":"","sources":["../../coarse-placer/featurize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,sLA6BjB,CAAA;AACV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAU,CAAA;AAyDlC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAoChD"}
|
|
@@ -15,20 +15,19 @@
|
|
|
15
15
|
* coarsely" tier.
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
|
-
* The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU expansion, and `OTHER` — the
|
|
19
|
+
* explicit off-map class (milestone 2) trained on non-Latin/non-CJK scripts via outlier exposure, so the model learns
|
|
20
|
+
* the edge of its competence and routes "probably off my loaded map" instead of a confident mis-placement. Index order
|
|
21
|
+
* is the label id.
|
|
22
22
|
*
|
|
23
|
-
* The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* its own `classes`, so this constant only drives training (`train.mjs`), not inference.
|
|
23
|
+
* The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the placer previously
|
|
24
|
+
* couldn't emit — ambiguous names there (FI "Helsinki", PL "Rybnik") landed off-continent in the population-first
|
|
25
|
+
* candidate gazetteer because no country prior pinned them. They're trained from the Overture per-country addresses
|
|
26
|
+
* theme (`build-dataset.mjs`), and they're pulled OUT of the Latin off-map OTHER outlier set
|
|
27
|
+
* (`build-outlier-latin.mjs`) that used to teach PL/PT/CZ → OTHER. Widening the class set is the soft-prior lever; it
|
|
28
|
+
* never hard-filters, so a neighbour confusion (DK↔NO, EE↔LT↔LV) still keeps resolution in-region, off the global-pop
|
|
29
|
+
* attractors. Adding a class requires a retrain + a fresh artifact — the bundled meta.json carries its own `classes`,
|
|
30
|
+
* so this constant only drives training (`train.mjs`), not inference.
|
|
32
31
|
*/
|
|
33
32
|
export const COARSE_CLASSES = [
|
|
34
33
|
"US",
|
|
@@ -61,9 +60,8 @@ export const COARSE_CLASSES = [
|
|
|
61
60
|
"OTHER",
|
|
62
61
|
];
|
|
63
62
|
/**
|
|
64
|
-
* Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8)
|
|
65
|
-
*
|
|
66
|
-
* are few.
|
|
63
|
+
* Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8) while collisions stay
|
|
64
|
+
* tolerable for a linear bag-of-features model; the discriminative n-grams are few.
|
|
67
65
|
*/
|
|
68
66
|
export const FEATURE_DIM = 1 << 16;
|
|
69
67
|
/** Coarse Unicode-script buckets — strong priors the n-grams refine. */
|
|
@@ -113,9 +111,9 @@ function bucket(s, salt) {
|
|
|
113
111
|
return (h >>> 0) % FEATURE_DIM;
|
|
114
112
|
}
|
|
115
113
|
/**
|
|
116
|
-
* Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the
|
|
117
|
-
*
|
|
118
|
-
*
|
|
114
|
+
* Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the lowercased,
|
|
115
|
+
* boundary-marked string + one presence token per Unicode script seen (+ the dominant script). Non-Latin characters are
|
|
116
|
+
* PRESERVED (lowercasing only touches cased scripts).
|
|
119
117
|
*/
|
|
120
118
|
export function featurize(text) {
|
|
121
119
|
const norm = text.toLowerCase().replace(/\s+/g, " ").trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featurize.js","sourceRoot":"","sources":["../../coarse-placer/featurize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;G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CAAA;IAE1B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAC9C,CAAC;IACF,CAAC;IAED,OAAO,CAAC,GAAG,MAAM,CAAC,CAAA;AACnB,CAAC"}
|
package/out/collections.d.ts
CHANGED
|
@@ -29,8 +29,7 @@ export declare function take<T>(collection: Iterable<T>, batchSize: number): Ite
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function iterateInParallel<T>(asyncIterable: AsyncIterable<T>): Promise<void>;
|
|
31
31
|
/**
|
|
32
|
-
* Given an iterable of values, maps each value to a record of the value and the result of the
|
|
33
|
-
* callback.
|
|
32
|
+
* Given an iterable of values, maps each value to a record of the value and the result of the callback.
|
|
34
33
|
*
|
|
35
34
|
* This is a convenience function when an iterable needs mapping to an object-like structure.
|
|
36
35
|
*
|
package/out/collections.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../collections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;KACjC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,GAAG,KAAK;CAC/C,CAAC,MAAM,CAAC,CAAC,CAAA;AAEV;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,C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,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrB;;GAEG;AACH,QAAQ,EAAE,CAAC,GACT,UAAU,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CA6B/F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAElE;AAED;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IAChE,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAA;CACtB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC,CAEpF"}
|
package/out/collections.js
CHANGED
|
@@ -45,8 +45,7 @@ export async function iterateInParallel(asyncIterable) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Given an iterable of values, maps each value to a record of the value and the result of the
|
|
49
|
-
* callback.
|
|
48
|
+
* Given an iterable of values, maps each value to a record of the value and the result of the callback.
|
|
50
49
|
*
|
|
51
50
|
* This is a convenience function when an iterable needs mapping to an object-like structure.
|
|
52
51
|
*
|
package/out/collections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../collections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;GAEG;AACH,MAAM,UAAU,KAAK,CAAmB,QAAqB,EAAE,IAA0B;IACxF,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,KAAK,MAAM,IAAI,IAAI,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,CACF,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAEE,CAAA;IAC5B,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAEjD,OAAO,aAEoB,CAAA;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAI,KAAc;IAC3C,OAAO,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;AACxC,CAAC;AASD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAI,KAAkB;IACtD,OAAO,KAAK,IAAI,OAAQ,KAAyB,CAAC,GAAG,KAAK,UAAU,CAAA;AACrE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Sister Software
|
|
4
|
+
* @license AGPL-3.0
|
|
5
|
+
* @author Teffen Ellis, et al.
|
|
6
|
+
*
|
|
7
|
+
* Download Google/Chromium's per-country `ssl-address` postal-address metadata — the
|
|
8
|
+
* {@link https://github.com/google/libaddressinput libaddressinput} AddressValidationMetadata that
|
|
9
|
+
* seeds the per-locale field order, required-field, and upper-casing conventions.
|
|
10
|
+
*
|
|
11
|
+
* See: https://github.com/google/libaddressinput/wiki/AddressValidationMetadata
|
|
12
|
+
*
|
|
13
|
+
* Replaces the bash `ssl-address-download.sh` (curl + jq) with native `fetch` + `JSON.parse`. The
|
|
14
|
+
* country list lives at `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's
|
|
15
|
+
* record is then fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
|
|
16
|
+
*
|
|
17
|
+
* ## Usage
|
|
18
|
+
*
|
|
19
|
+
* ```sh
|
|
20
|
+
* node core/data/chromium-i18n/ssl-address-download.ts
|
|
21
|
+
* node core/data/chromium-i18n/ssl-address-download.ts --concurrency 16
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Flags
|
|
25
|
+
*
|
|
26
|
+
* - `--out-dir <path>` — destination directory; default `./ssl-address` (next to this script)
|
|
27
|
+
* - `--concurrency <n>` — parallel per-country fetches; default `8`
|
|
28
|
+
*/
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=ssl-address-download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssl-address-download.d.ts","sourceRoot":"","sources":["../../../data/chromium-i18n/ssl-address-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Sister Software
|
|
4
|
+
* @license AGPL-3.0
|
|
5
|
+
* @author Teffen Ellis, et al.
|
|
6
|
+
*
|
|
7
|
+
* Download Google/Chromium's per-country `ssl-address` postal-address metadata — the
|
|
8
|
+
* {@link https://github.com/google/libaddressinput libaddressinput} AddressValidationMetadata that
|
|
9
|
+
* seeds the per-locale field order, required-field, and upper-casing conventions.
|
|
10
|
+
*
|
|
11
|
+
* See: https://github.com/google/libaddressinput/wiki/AddressValidationMetadata
|
|
12
|
+
*
|
|
13
|
+
* Replaces the bash `ssl-address-download.sh` (curl + jq) with native `fetch` + `JSON.parse`. The
|
|
14
|
+
* country list lives at `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's
|
|
15
|
+
* record is then fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
|
|
16
|
+
*
|
|
17
|
+
* ## Usage
|
|
18
|
+
*
|
|
19
|
+
* ```sh
|
|
20
|
+
* node core/data/chromium-i18n/ssl-address-download.ts
|
|
21
|
+
* node core/data/chromium-i18n/ssl-address-download.ts --concurrency 16
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Flags
|
|
25
|
+
*
|
|
26
|
+
* - `--out-dir <path>` — destination directory; default `./ssl-address` (next to this script)
|
|
27
|
+
* - `--concurrency <n>` — parallel per-country fetches; default `8`
|
|
28
|
+
*/
|
|
29
|
+
///<reference types="node" />
|
|
30
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
31
|
+
import { join } from "node:path";
|
|
32
|
+
import { fileURLToPath } from "node:url";
|
|
33
|
+
import { parseArgs } from "node:util";
|
|
34
|
+
const BASE_URL = "https://chromium-i18n.appspot.com/ssl-address/data";
|
|
35
|
+
function parseCLIArgs() {
|
|
36
|
+
const { values } = parseArgs({
|
|
37
|
+
options: {
|
|
38
|
+
"out-dir": { type: "string", default: fileURLToPath(new URL("./ssl-address/", import.meta.url)) },
|
|
39
|
+
concurrency: { type: "string", default: "8" },
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
outDir: values["out-dir"],
|
|
44
|
+
concurrency: Number.parseInt(values.concurrency, 10),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Fetch the `~`-delimited country list and return it as an array of ISO codes. */
|
|
48
|
+
async function fetchCountryCodes() {
|
|
49
|
+
const res = await fetch(BASE_URL, { signal: AbortSignal.timeout(60_000) });
|
|
50
|
+
if (!res.ok)
|
|
51
|
+
throw new Error(`HTTP ${res.status} ${res.statusText} fetching country list`);
|
|
52
|
+
const data = (await res.json());
|
|
53
|
+
return (data.countries ?? "").split("~").filter(Boolean);
|
|
54
|
+
}
|
|
55
|
+
/** Fetch a single country's metadata record and write its raw JSON body to `<outDir>/<cc>.json`. */
|
|
56
|
+
async function fetchCountry(cc, outDir) {
|
|
57
|
+
const res = await fetch(`${BASE_URL}/${cc}`, { signal: AbortSignal.timeout(60_000) });
|
|
58
|
+
if (!res.ok)
|
|
59
|
+
throw new Error(`HTTP ${res.status} ${res.statusText} on ${cc}`);
|
|
60
|
+
await writeFile(join(outDir, `${cc}.json`), await res.text());
|
|
61
|
+
}
|
|
62
|
+
async function main() {
|
|
63
|
+
const { outDir, concurrency } = parseCLIArgs();
|
|
64
|
+
await mkdir(outDir, { recursive: true });
|
|
65
|
+
const codes = await fetchCountryCodes();
|
|
66
|
+
process.stderr.write(`=== ssl-address: ${codes.length} countries → ${outDir}\n`);
|
|
67
|
+
let nextSlot = 0;
|
|
68
|
+
let failures = 0;
|
|
69
|
+
const workers = Array.from({ length: Math.min(concurrency, codes.length) }, async () => {
|
|
70
|
+
while (true) {
|
|
71
|
+
const slot = nextSlot++;
|
|
72
|
+
if (slot >= codes.length)
|
|
73
|
+
return;
|
|
74
|
+
const cc = codes[slot];
|
|
75
|
+
try {
|
|
76
|
+
await fetchCountry(cc, outDir);
|
|
77
|
+
process.stderr.write(` ✓ ${cc}\n`);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
failures++;
|
|
81
|
+
process.stderr.write(` ✗ ${cc}: ${err.message}\n`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
await Promise.all(workers);
|
|
86
|
+
process.stderr.write(`\n=== done: ${codes.length - failures}/${codes.length} written, ${failures} failed\n`);
|
|
87
|
+
if (failures > 0)
|
|
88
|
+
process.exitCode = 1;
|
|
89
|
+
}
|
|
90
|
+
// Run main() only when invoked directly (the import-safe equivalent of Python's `if __name__ ==
|
|
91
|
+
// "__main__"`), so importing this module evaluates it without firing the download.
|
|
92
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
93
|
+
main().catch((err) => {
|
|
94
|
+
process.stderr.write(`fatal: ${err.message}\n${err.stack}\n`);
|
|
95
|
+
process.exitCode = 1;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=ssl-address-download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssl-address-download.js","sourceRoot":"","sources":["../../../data/chromium-i18n/ssl-address-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,6BAA6B;AAE7B,OAAO,EAAE,KAAK,EAAE,SAA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+
* Download + alphabetize libpostal's `resources/dictionaries` — the per-language abbreviation,
|
|
8
|
+
* street-type, and synonym tables the normalizer expands against. Shallow-clones
|
|
9
|
+
* {@link https://github.com/openvenues/libpostal openvenues/libpostal}, sorts each dictionary file
|
|
10
|
+
* in place, and copies the `dictionaries/` tree next to this script.
|
|
11
|
+
*
|
|
12
|
+
* Replaces the bash `resources-download.sh`. `git clone` runs through zx's `$` (no clean native
|
|
13
|
+
* equivalent); everything else is `node:fs` / `node:os`. Sorting is done in-process with a plain
|
|
14
|
+
* code-point `Array.sort()`, which matches `LC_ALL=C sort` byte order — deterministic and free of
|
|
15
|
+
* the shell `sort`'s locale dependency (the original relied on the ambient locale).
|
|
16
|
+
*
|
|
17
|
+
* ## Usage
|
|
18
|
+
*
|
|
19
|
+
* ```sh
|
|
20
|
+
* node core/data/libpostal/resources-download.ts
|
|
21
|
+
* node core/data/libpostal/resources-download.ts --force # overwrite an existing ./dictionaries
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Flags
|
|
25
|
+
*
|
|
26
|
+
* - `--force` — delete an existing `./dictionaries` directory instead of erroring out
|
|
27
|
+
*/
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=resources-download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources-download.d.ts","sourceRoot":"","sources":["../../../data/libpostal/resources-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Sister Software
|
|
4
|
+
* @license AGPL-3.0
|
|
5
|
+
* @author Teffen Ellis, et al.
|
|
6
|
+
*
|
|
7
|
+
* Download + alphabetize libpostal's `resources/dictionaries` — the per-language abbreviation,
|
|
8
|
+
* street-type, and synonym tables the normalizer expands against. Shallow-clones
|
|
9
|
+
* {@link https://github.com/openvenues/libpostal openvenues/libpostal}, sorts each dictionary file
|
|
10
|
+
* in place, and copies the `dictionaries/` tree next to this script.
|
|
11
|
+
*
|
|
12
|
+
* Replaces the bash `resources-download.sh`. `git clone` runs through zx's `$` (no clean native
|
|
13
|
+
* equivalent); everything else is `node:fs` / `node:os`. Sorting is done in-process with a plain
|
|
14
|
+
* code-point `Array.sort()`, which matches `LC_ALL=C sort` byte order — deterministic and free of
|
|
15
|
+
* the shell `sort`'s locale dependency (the original relied on the ambient locale).
|
|
16
|
+
*
|
|
17
|
+
* ## Usage
|
|
18
|
+
*
|
|
19
|
+
* ```sh
|
|
20
|
+
* node core/data/libpostal/resources-download.ts
|
|
21
|
+
* node core/data/libpostal/resources-download.ts --force # overwrite an existing ./dictionaries
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Flags
|
|
25
|
+
*
|
|
26
|
+
* - `--force` — delete an existing `./dictionaries` directory instead of erroring out
|
|
27
|
+
*/
|
|
28
|
+
///<reference types="node" />
|
|
29
|
+
import { cp, mkdtemp, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
30
|
+
import { tmpdir } from "node:os";
|
|
31
|
+
import { join } from "node:path";
|
|
32
|
+
import { fileURLToPath } from "node:url";
|
|
33
|
+
import { parseArgs } from "node:util";
|
|
34
|
+
import { $ } from "zx";
|
|
35
|
+
const REPO_URL = "https://github.com/openvenues/libpostal.git";
|
|
36
|
+
const DICTIONARIES_DIR = fileURLToPath(new URL("./dictionaries", import.meta.url));
|
|
37
|
+
function parseCLIArgs() {
|
|
38
|
+
const { values } = parseArgs({
|
|
39
|
+
options: {
|
|
40
|
+
force: { type: "boolean", default: false },
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return { force: values.force };
|
|
44
|
+
}
|
|
45
|
+
/** Whether a path exists and is a directory. */
|
|
46
|
+
async function isDirectory(path) {
|
|
47
|
+
try {
|
|
48
|
+
return (await stat(path)).isDirectory();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sort a single dictionary file in place by code point (matching `LC_ALL=C sort`). Blank lines sort to the top, exactly
|
|
56
|
+
* as `sort` orders empty strings; a trailing newline is preserved.
|
|
57
|
+
*/
|
|
58
|
+
async function sortFileInPlace(path) {
|
|
59
|
+
const text = await readFile(path, "utf8");
|
|
60
|
+
const hadTrailingNewline = text.endsWith("\n");
|
|
61
|
+
const lines = text.split("\n");
|
|
62
|
+
// Drop the empty element produced by a trailing newline so it isn't re-sorted as a blank line.
|
|
63
|
+
if (hadTrailingNewline)
|
|
64
|
+
lines.pop();
|
|
65
|
+
lines.sort();
|
|
66
|
+
await writeFile(path, lines.join("\n") + (hadTrailingNewline ? "\n" : ""));
|
|
67
|
+
}
|
|
68
|
+
async function main() {
|
|
69
|
+
const { force } = parseCLIArgs();
|
|
70
|
+
// Guard the destination exactly as the bash version did: refuse to clobber unless --force.
|
|
71
|
+
if (await isDirectory(DICTIONARIES_DIR)) {
|
|
72
|
+
if (force) {
|
|
73
|
+
process.stderr.write("Warning: The dictionaries directory already exists. Deleting it due to --force flag.\n");
|
|
74
|
+
await rm(DICTIONARIES_DIR, { recursive: true, force: true });
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
process.stderr.write("Error: The dictionaries directory already exists. Please remove it first or use the --force flag.\n");
|
|
78
|
+
process.exitCode = 1;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const tempDir = await mkdtemp(join(tmpdir(), "libpostal-"));
|
|
83
|
+
try {
|
|
84
|
+
const cloneDir = join(tempDir, "libpostal");
|
|
85
|
+
await $ `git clone --depth 1 ${REPO_URL} ${cloneDir}`;
|
|
86
|
+
const sourceDicts = join(cloneDir, "resources", "dictionaries");
|
|
87
|
+
// Alphabetize the contents of each dictionary file in place.
|
|
88
|
+
for (const entry of await readdir(sourceDicts, { withFileTypes: true })) {
|
|
89
|
+
if (entry.isFile())
|
|
90
|
+
await sortFileInPlace(join(sourceDicts, entry.name));
|
|
91
|
+
}
|
|
92
|
+
// Copy the (now-sorted) dictionaries tree next to this script.
|
|
93
|
+
await cp(sourceDicts, DICTIONARIES_DIR, { recursive: true });
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Run main() only when invoked directly (the import-safe equivalent of Python's `if __name__ ==
|
|
100
|
+
// "__main__"`), so importing this module evaluates it without cloning anything.
|
|
101
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
102
|
+
main().catch((err) => {
|
|
103
|
+
process.stderr.write(`fatal: ${err.message}\n${err.stack}\n`);
|
|
104
|
+
process.exitCode = 1;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=resources-download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources-download.js","sourceRoot":"","sources":["../../../data/libpostal/resources-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,6BAA6B;AAE7B,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,CAAC,EAAE,MAAM,IAAI,CAAA;AAEtB,MAAM,QAAQ,GAAG,6CAA6C,CAAA;AAC9D,MAAM,gBAAgB,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,I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AC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAA;QAC7D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACrB,CAAC,CAAC,CAAA;AACH,CAAC"}
|
package/out/db/schema.d.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* Empty schema marker. Consumers declare their own schema interface and pass it directly to `new
|
|
17
|
-
* Kysely<MySchema>({...})` or instantiate `new DatabaseClient<MySchema>(...)` once `DatabaseClient`
|
|
18
|
-
*
|
|
17
|
+
* Kysely<MySchema>({...})` or instantiate `new DatabaseClient<MySchema>(...)` once `DatabaseClient` becomes generic
|
|
18
|
+
* (Phase 4.2 work).
|
|
19
19
|
*/
|
|
20
20
|
export type Database = Record<string, never>;
|
|
21
21
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
import type { ClassificationProposal } from "../types/index.js";
|
|
35
35
|
import type { AddressTree } from "./types.js";
|
|
36
36
|
/**
|
|
37
|
-
* Edit the nested neural argmax tree with the solved v0 (rule) parse under the `rule_preferred`
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Edit the nested neural argmax tree with the solved v0 (rule) parse under the `rule_preferred` route — relabel
|
|
38
|
+
* same-span tag disagreements toward rule, add rule-only non-overlapping missing tags. Containment-preserving (no
|
|
39
|
+
* flatten, no restructure). Input is not mutated.
|
|
40
40
|
*
|
|
41
41
|
* @param tree The neural argmax `AddressTree`.
|
|
42
42
|
* @param ruleProposals Proposals from the solved v0 parse (`solutionToProposals`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbitrate-tree.d.ts","sourceRoot":"","sources":["../../decoder/arbitrate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAU1D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,sBAAsB,EAAE,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"arbitrate-tree.d.ts","sourceRoot":"","sources":["../../decoder/arbitrate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAU1D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,sBAAsB,EAAE,GAAG,WAAW,CAuDrH"}
|