@mailwoman/core 4.16.1 → 5.0.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 +17 -20
- 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/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 +18 -18
- 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
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
|
|
30
|
+
///<reference types="node" />
|
|
31
|
+
|
|
32
|
+
import { mkdir, writeFile } from "node:fs/promises"
|
|
33
|
+
import { join } from "node:path"
|
|
34
|
+
import { fileURLToPath } from "node:url"
|
|
35
|
+
import { parseArgs } from "node:util"
|
|
36
|
+
|
|
37
|
+
const BASE_URL = "https://chromium-i18n.appspot.com/ssl-address/data"
|
|
38
|
+
|
|
39
|
+
function parseCLIArgs() {
|
|
40
|
+
const { values } = parseArgs({
|
|
41
|
+
options: {
|
|
42
|
+
"out-dir": { type: "string", default: fileURLToPath(new URL("./ssl-address/", import.meta.url)) },
|
|
43
|
+
concurrency: { type: "string", default: "8" },
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
outDir: values["out-dir"]!,
|
|
49
|
+
concurrency: Number.parseInt(values.concurrency!, 10),
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Fetch the `~`-delimited country list and return it as an array of ISO codes. */
|
|
54
|
+
async function fetchCountryCodes(): Promise<string[]> {
|
|
55
|
+
const res = await fetch(BASE_URL, { signal: AbortSignal.timeout(60_000) })
|
|
56
|
+
|
|
57
|
+
if (!res.ok) throw new Error(`HTTP ${res.status} ${res.statusText} fetching country list`)
|
|
58
|
+
const data = (await res.json()) as { countries?: string }
|
|
59
|
+
|
|
60
|
+
return (data.countries ?? "").split("~").filter(Boolean)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Fetch a single country's metadata record and write its raw JSON body to `<outDir>/<cc>.json`. */
|
|
64
|
+
async function fetchCountry(cc: string, outDir: string): Promise<void> {
|
|
65
|
+
const res = await fetch(`${BASE_URL}/${cc}`, { signal: AbortSignal.timeout(60_000) })
|
|
66
|
+
|
|
67
|
+
if (!res.ok) throw new Error(`HTTP ${res.status} ${res.statusText} on ${cc}`)
|
|
68
|
+
await writeFile(join(outDir, `${cc}.json`), await res.text())
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function main(): Promise<void> {
|
|
72
|
+
const { outDir, concurrency } = parseCLIArgs()
|
|
73
|
+
await mkdir(outDir, { recursive: true })
|
|
74
|
+
|
|
75
|
+
const codes = await fetchCountryCodes()
|
|
76
|
+
process.stderr.write(`=== ssl-address: ${codes.length} countries → ${outDir}\n`)
|
|
77
|
+
|
|
78
|
+
let nextSlot = 0
|
|
79
|
+
let failures = 0
|
|
80
|
+
const workers = Array.from({ length: Math.min(concurrency, codes.length) }, async () => {
|
|
81
|
+
while (true) {
|
|
82
|
+
const slot = nextSlot++
|
|
83
|
+
|
|
84
|
+
if (slot >= codes.length) return
|
|
85
|
+
const cc = codes[slot]!
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
await fetchCountry(cc, outDir)
|
|
89
|
+
process.stderr.write(` ✓ ${cc}\n`)
|
|
90
|
+
} catch (err) {
|
|
91
|
+
failures++
|
|
92
|
+
process.stderr.write(` ✗ ${cc}: ${(err as Error).message}\n`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
await Promise.all(workers)
|
|
97
|
+
|
|
98
|
+
process.stderr.write(`\n=== done: ${codes.length - failures}/${codes.length} written, ${failures} failed\n`)
|
|
99
|
+
|
|
100
|
+
if (failures > 0) process.exitCode = 1
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Run main() only when invoked directly (the import-safe equivalent of Python's `if __name__ ==
|
|
104
|
+
// "__main__"`), so importing this module evaluates it without firing the download.
|
|
105
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
106
|
+
main().catch((err: Error) => {
|
|
107
|
+
process.stderr.write(`fatal: ${err.message}\n${err.stack}\n`)
|
|
108
|
+
process.exitCode = 1
|
|
109
|
+
})
|
|
110
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
|
|
29
|
+
///<reference types="node" />
|
|
30
|
+
|
|
31
|
+
import { cp, mkdtemp, readdir, readFile, rm, stat, writeFile } from "node:fs/promises"
|
|
32
|
+
import { tmpdir } from "node:os"
|
|
33
|
+
import { join } from "node:path"
|
|
34
|
+
import { fileURLToPath } from "node:url"
|
|
35
|
+
import { parseArgs } from "node:util"
|
|
36
|
+
|
|
37
|
+
import { $ } from "zx"
|
|
38
|
+
|
|
39
|
+
const REPO_URL = "https://github.com/openvenues/libpostal.git"
|
|
40
|
+
const DICTIONARIES_DIR = fileURLToPath(new URL("./dictionaries", import.meta.url))
|
|
41
|
+
|
|
42
|
+
function parseCLIArgs() {
|
|
43
|
+
const { values } = parseArgs({
|
|
44
|
+
options: {
|
|
45
|
+
force: { type: "boolean", default: false },
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
return { force: values.force! }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Whether a path exists and is a directory. */
|
|
53
|
+
async function isDirectory(path: string): Promise<boolean> {
|
|
54
|
+
try {
|
|
55
|
+
return (await stat(path)).isDirectory()
|
|
56
|
+
} catch {
|
|
57
|
+
return false
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Sort a single dictionary file in place by code point (matching `LC_ALL=C sort`). Blank lines sort to the top, exactly
|
|
63
|
+
* as `sort` orders empty strings; a trailing newline is preserved.
|
|
64
|
+
*/
|
|
65
|
+
async function sortFileInPlace(path: string): Promise<void> {
|
|
66
|
+
const text = await readFile(path, "utf8")
|
|
67
|
+
const hadTrailingNewline = text.endsWith("\n")
|
|
68
|
+
const lines = text.split("\n")
|
|
69
|
+
|
|
70
|
+
// Drop the empty element produced by a trailing newline so it isn't re-sorted as a blank line.
|
|
71
|
+
if (hadTrailingNewline) lines.pop()
|
|
72
|
+
lines.sort()
|
|
73
|
+
await writeFile(path, lines.join("\n") + (hadTrailingNewline ? "\n" : ""))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function main(): Promise<void> {
|
|
77
|
+
const { force } = parseCLIArgs()
|
|
78
|
+
|
|
79
|
+
// Guard the destination exactly as the bash version did: refuse to clobber unless --force.
|
|
80
|
+
if (await isDirectory(DICTIONARIES_DIR)) {
|
|
81
|
+
if (force) {
|
|
82
|
+
process.stderr.write("Warning: The dictionaries directory already exists. Deleting it due to --force flag.\n")
|
|
83
|
+
await rm(DICTIONARIES_DIR, { recursive: true, force: true })
|
|
84
|
+
} else {
|
|
85
|
+
process.stderr.write(
|
|
86
|
+
"Error: The dictionaries directory already exists. Please remove it first or use the --force flag.\n"
|
|
87
|
+
)
|
|
88
|
+
process.exitCode = 1
|
|
89
|
+
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const tempDir = await mkdtemp(join(tmpdir(), "libpostal-"))
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
const cloneDir = join(tempDir, "libpostal")
|
|
98
|
+
await $`git clone --depth 1 ${REPO_URL} ${cloneDir}`
|
|
99
|
+
|
|
100
|
+
const sourceDicts = join(cloneDir, "resources", "dictionaries")
|
|
101
|
+
|
|
102
|
+
// Alphabetize the contents of each dictionary file in place.
|
|
103
|
+
for (const entry of await readdir(sourceDicts, { withFileTypes: true })) {
|
|
104
|
+
if (entry.isFile()) await sortFileInPlace(join(sourceDicts, entry.name))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Copy the (now-sorted) dictionaries tree next to this script.
|
|
108
|
+
await cp(sourceDicts, DICTIONARIES_DIR, { recursive: true })
|
|
109
|
+
} finally {
|
|
110
|
+
await rm(tempDir, { recursive: true, force: true })
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Run main() only when invoked directly (the import-safe equivalent of Python's `if __name__ ==
|
|
115
|
+
// "__main__"`), so importing this module evaluates it without cloning anything.
|
|
116
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
117
|
+
main().catch((err: Error) => {
|
|
118
|
+
process.stderr.write(`fatal: ${err.message}\n${err.stack}\n`)
|
|
119
|
+
process.exitCode = 1
|
|
120
|
+
})
|
|
121
|
+
}
|
package/out/api/APIClient.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export interface APIClientConfig {
|
|
|
29
29
|
axios?: CreateAxiosDefaults;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* A base class for API clients used in Mailwoman, providing features like request cooldowns,
|
|
33
|
-
*
|
|
32
|
+
* A base class for API clients used in Mailwoman, providing features like request cooldowns, response caching, and
|
|
33
|
+
* integrated logging.
|
|
34
34
|
*/
|
|
35
35
|
export declare class APIClient<C extends APIClientConfig = APIClientConfig> extends EventTarget implements AsyncDisposable {
|
|
36
36
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIClient.d.ts","sourceRoot":"","sources":["../../api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAc,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAA;AACxH,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAEjB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"APIClient.d.ts","sourceRoot":"","sources":["../../api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAc,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAA;AACxH,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAEjB,MAAM,yBAAyB,CAAA;AAKhC,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAC3B;AAED;;;GAGG;AACH,qBAAa,SAAS,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAAE,SAAQ,WAAY,YAAW,eAAe;;IACjH,SAAgB,MAAM,EAAE,CAAC,CAAA;IAOzB,IAAW,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;IAED;;OAEG;IACH,SAAgB,MAAM,EAAE,cAAc,CAAA;IACtC;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,GAAG,kBAAkB,CAAA;gBAE7C,MAAM,EAAE,CAAC;IAyCrB;;OAEG;IACI,KAAK,GAAU,CAAC,EAAE,SAAS,kBAAkB,KAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAO/E;IAED,SAAS,CAAC,WAAW,GAAI,cAAc,MAAM,KAAG,IAAI,CAYnD;IAED,SAAS,CAAC,2BAA2B,GACpC,UAAU,kBAAkB,GAAG,aAAa,KAC1C,kBAAkB,GAAG,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAkBtD;IAEY,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC,QAAQ;CAGxB"}
|
package/out/api/APIClient.js
CHANGED
|
@@ -9,8 +9,8 @@ import { setupCache, } from "axios-cache-interceptor";
|
|
|
9
9
|
import { ServiceSymbol } from "../lifecycle/ServiceSymbol.js";
|
|
10
10
|
import { delegateAxiosError } from "./responses.js";
|
|
11
11
|
/**
|
|
12
|
-
* A base class for API clients used in Mailwoman, providing features like request cooldowns,
|
|
13
|
-
*
|
|
12
|
+
* A base class for API clients used in Mailwoman, providing features like request cooldowns, response caching, and
|
|
13
|
+
* integrated logging.
|
|
14
14
|
*/
|
|
15
15
|
export class APIClient extends EventTarget {
|
|
16
16
|
config;
|
package/out/api/APIClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIClient.js","sourceRoot":"","sources":["../../api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAuB,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,EAA6F,MAAM,OAAO,CAAA;AACxH,OAAO,EAIN,UAAU,GACV,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"APIClient.js","sourceRoot":"","sources":["../../api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAuB,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,EAA6F,MAAM,OAAO,CAAA;AACxH,OAAO,EAIN,UAAU,GACV,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AA6BnD;;;GAGG;AACH,MAAM,OAAO,SAAuD,SAAQ,WAAW;IACtE,MAAM,CAAG;IAEzB,sBAAsB,GAAsC,IAAI,CAAA;IAChE,gBAAgB,GAAG,CAAC,CAAA;IACpB,2BAA2B,GAAG,CAAC,CAAA;IAC/B,gBAAgB,GAAG,CAAC,CAAA;IAEpB,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,sBAAsB,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;IACjE,CAAC;IAED;;OAEG;IACa,MAAM,CAAgB;IACtC;;OAEG;IACa,KAAK,CAAoC;IAEz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AE,CAAA;QACtB,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,CAAA;QACjD,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAA;QAE3B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB;YAAE,OAAO,QAAQ,CAAA;QAEnD,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAElC,MAAM,OAAO,GAAG,GAAG,GAAG,mBAAmB,CAAA;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAA;QAEhD,IAAI,IAAI,CAAC,2BAA2B,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YACvE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAA;IAChB,CAAC,CAAA;IAEM,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACjC,IAAI,CAAC,sBAAsB,EAAE,OAAO,EAAE,CAAA;QAEtC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAA;QAEhD,IAAI,aAAa,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC;YAClD,MAAM,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAA;QACzC,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;IAEe,QAAQ;QACvB,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,aAAa,CAAA;IAC/C,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../api/responses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../api/responses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,IAAI;IACtC,IAAI,EAAE,IAAI,CAAA;CACV;AAED,MAAM,MAAM,YAAY,CAAC,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,iBAAiB,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,CAAA;AAmBvF;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,CAAC,IAAI,IAAI,IAAI,SAAS;IACxD,IAAI,EAAE,MAAM,IAAI,CAAA;CAChB,GACE,uBAAuB,CAAC,IAAI,CAAC,GAC7B,IAAI,CAAA;AAEP;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;AASlH,wBAAgB,iBAAiB,CAChC,eAAe,GAAE,GAAG,GAAG,MAA6D,GAClF,OAAO,CAAC,OAAO,CAAC,CAMlB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CA0CzE"}
|
package/out/api/responses.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../api/responses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../api/responses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,q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S,EACT,aAAa,CACb,CAAA;QACH,CAAC;QAED,IAAI,CAAC,QAAQ;YAAE,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;QAErG,IAAI,QAAQ,CAAC,MAAM,KAAK,cAAc,CAAC,YAAY,EAAE,CAAC;YACrD,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAA;QAC9C,CAAC;QAED,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACvB,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;QACnF,CAAC;QAED,QAAQ,gBAAgB,EAAE,CAAC;YAC1B,KAAK,UAAU,CAAC,WAAW;gBAC1B,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAA;YACrD,KAAK,UAAU,CAAC,YAAY,CAAC;YAC7B,KAAK,UAAU,CAAC,YAAY,CAAC;YAC7B,KAAK,UAAU,CAAC,SAAS;gBACxB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;YACzB;gBACC,aAAa,CAAC,IAAI,CAAC,4BAA4B,gBAAgB,EAAE,CAAC,CAAA;QACpE,CAAC;QAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACF,CAAC"}
|
|
@@ -45,13 +45,12 @@ export interface ClassificationMatch {
|
|
|
45
45
|
/**
|
|
46
46
|
* Languages for which the classification is valid.
|
|
47
47
|
*
|
|
48
|
-
* If a language is present in this set, it means that the value which it is associated with is a
|
|
49
|
-
*
|
|
48
|
+
* If a language is present in this set, it means that the value which it is associated with is a valid value in that
|
|
49
|
+
* language.
|
|
50
50
|
*/
|
|
51
51
|
readonly languages?: Displayable<ReadonlySet<LibPostalLanguageCode | Alpha3bLanguageCode>>;
|
|
52
52
|
/**
|
|
53
|
-
* Flags associated with the classification, i.e. clarifying details to enhance the
|
|
54
|
-
* classification.
|
|
53
|
+
* Flags associated with the classification, i.e. clarifying details to enhance the classification.
|
|
55
54
|
*/
|
|
56
55
|
readonly flags?: Set<string>;
|
|
57
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Classification.d.ts","sourceRoot":"","sources":["../../classification/Classification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,eAAe,gmBA0CjB,CAAA;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAIpF;;GAEG;AACH,QAAA,MAAM,qBAAqB,sKAaW,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAEjG;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,mBAAmB,GACxB,KAAK,IAAI,mBAAmB,GAAG;IAAE,cAAc,EAAE,qBAAqB,CAAA;CAAE,CAAA;AAC3E,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,cAAc,GAAG,cAAc,IAAI,qBAAqB,CAAA;AAOhH,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,qBAAqB,EAAE,MAAM,EAAE,CAAC,CAAA;AACpE,MAAM,MAAM,2BAA2B,GAAG,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;AAC5E,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,qBA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CAS3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Classification.js","sourceRoot":"","sources":["../../classification/Classification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACtC,UAAU;IACV,OAAO;IACP,cAAc;IACd,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,aAAa;IACb,4BAA4B;IAC5B,WAAW;IACX,YAAY;IACZ,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,aAAa;IACb,SAAS;IACT,SAAS;IACT,QAAQ;IACR,iBAAiB;IACjB,gBAAgB;IAChB,OAAO;IACP,UAAU;IACV,aAAa;IACb,QAAQ;IACR,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,QAAQ;IACR,SAAS;IACT,SAAS;IACT,iBAAiB;IACjB,MAAM;IACN,SAAS;IACT,OAAO;CACE,CAAC,CAAA;AAIX,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAyB,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AAExF;;GAEG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACrC,SAAS;IACT,YAAY;IACZ,cAAc;IACd,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,iBAAiB;IACjB,MAAM;IACN,OAAO;CAC6B,CAAC,CAAA;AActC,MAAM,UAAU,uBAAuB,CAAC,KAA2C;IAClF,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAA;IAE/E,OAAO,qBAAqB,CAAC,GAAG,CAAC,cAAuC,CAAC,CAAA;AAC1E,CAAC;
|
|
1
|
+
{"version":3,"file":"Classification.js","sourceRoot":"","sources":["../../classification/Classification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACtC,UAAU;IACV,OAAO;IACP,cAAc;IACd,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,aAAa;IACb,4BAA4B;IAC5B,WAAW;IACX,YAAY;IACZ,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,aAAa;IACb,SAAS;IACT,SAAS;IACT,QAAQ;IACR,iBAAiB;IACjB,gBAAgB;IAChB,OAAO;IACP,UAAU;IACV,aAAa;IACb,QAAQ;IACR,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,QAAQ;IACR,SAAS;IACT,SAAS;IACT,iBAAiB;IACjB,MAAM;IACN,SAAS;IACT,OAAO;CACE,CAAC,CAAA;AAIX,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAyB,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AAExF;;GAEG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACrC,SAAS;IACT,YAAY;IACZ,cAAc;IACd,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,iBAAiB;IACjB,MAAM;IACN,OAAO;CAC6B,CAAC,CAAA;AActC,MAAM,UAAU,uBAAuB,CAAC,KAA2C;IAClF,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAA;IAE/E,OAAO,qBAAqB,CAAC,GAAG,CAAC,cAAuC,CAAC,CAAA;AAC1E,CAAC;AAqCD;;GAEG;AACH,MAAM,OAAO,uBAAwB,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CAAA;QACjH,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAE/C,iEAAiE;QACjE,IAAI,QAAQ,IAAI,QAAQ,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACzD,OAAM;QACP,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,KAA4B,CAAC,CAAA;IAC7D,CAAC;IAED;;OAEG;IACI,wBAAwB,CAAC,cAAsC;QACrE,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;IAC5G,CAAC;IAED;;OAEG;IACI,MAAM;QACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAA;IAC/B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,KAAkC;QAChD,MAAM,GAAG,GAAG,IAAI,uBAAuB,EAAE,CAAA;QAEzC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;YAC3B,GAAG,CAAC,GAAG,CAAC,KAA4B,CAAC,CAAA;QACtC,CAAC;QAED,OAAO,GAAG,CAAA;IACX,CAAC;CACD"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Span } from "@mailwoman/core/tokenization";
|
|
7
7
|
import type { Classification } from "./Classification.js";
|
|
8
|
-
import { SectionClassifier } from "./SectionClassifier.js";
|
|
9
8
|
import { type ClassifierSchemeConfig } from "./scheme.js";
|
|
9
|
+
import { SectionClassifier } from "./SectionClassifier.js";
|
|
10
10
|
export declare abstract class CompositeClassifier extends SectionClassifier {
|
|
11
11
|
schemes: ClassifierSchemeConfig[];
|
|
12
12
|
readonly primaryClassification: Classification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeClassifier.d.ts","sourceRoot":"","sources":["../../classification/CompositeClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"CompositeClassifier.d.ts","sourceRoot":"","sources":["../../classification/CompositeClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAwB1D,8BAAsB,mBAAoB,SAAQ,iBAAiB;IAC3D,OAAO,EAAE,sBAAsB,EAAE,CAAA;IACxC,SAAgB,qBAAqB,EAAE,cAAc,CAAA;gBAEzC,qBAAqB,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAMrF,OAAO,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI;CAkGnC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*/
|
|
6
6
|
import { Span } from "@mailwoman/core/tokenization";
|
|
7
|
-
import { SectionClassifier } from "./SectionClassifier.js";
|
|
8
7
|
import { phraseMatchesScheme } from "./scheme.js";
|
|
8
|
+
import { SectionClassifier } from "./SectionClassifier.js";
|
|
9
9
|
/**
|
|
10
10
|
* Compute the cartesian product of two or more arrays.
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeClassifier.js","sourceRoot":"","sources":["../../classification/CompositeClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;
|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AAK,GAAG,CAAC;qBACjD,OAAO,EAAE,CACX,CAAA;YACF,CAAC,CAAC,CAAA;YAEF,6BAA6B;YAC7B,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;gBACpC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,qBAAqB,CAAA;gBAE1E,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC;oBAC/B,cAAc;oBACd,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC7B,SAAS,EAAE,WAAW,CAAC,SAAS;iBAChC,CAAC,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,yCAAyC;YACzC,KAAK,MAAM,KAAK,IAAI,kBAAkB,EAAE,CAAC;gBACxC,KAAK,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;oBACxD,IAAI,CAAC,WAAW,CAAC,cAAc;wBAAE,SAAQ;oBAEzC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;oBAErB,IAAI,CAAC,IAAI;wBAAE,SAAQ;oBAEnB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC;wBACxB,cAAc,EAAE,WAAW,CAAC,cAAc;wBAC1C,UAAU,EAAE,WAAW,CAAC,UAAU;wBAClC,SAAS,EAAE,IAAI,CAAC,SAAS;qBACzB,CAAC,CAAA;gBACH,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhraseClassifier.d.ts","sourceRoot":"","sources":["../../classification/PhraseClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"PhraseClassifier.d.ts","sourceRoot":"","sources":["../../classification/PhraseClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAExE,8BAAsB,gBAAiB,YAAW,UAAU;IACpD,KAAK,EAAG,WAAW,CAAC,qBAAqB,CAAC,CAAA;IACjD,SAAS,CAAC,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAA;gBAEjC,EAAE,SAAS,EAAE,GAAE,iBAAsB;IAIjD;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAE/E;;OAEG;IACI,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAc3C,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI;CAO3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhraseClassifier.js","sourceRoot":"","sources":["../../classification/PhraseClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"PhraseClassifier.js","sourceRoot":"","sources":["../../classification/PhraseClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAIjE,MAAM,OAAgB,gBAAgB;IAC9B,KAAK,CAAqC;IACvC,SAAS,CAA0B;IAE7C,YAAY,EAAE,SAAS,KAAwB,EAAE;QAChD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,CAAC;IAOD;;OAEG;IACI,cAAc,CAAC,OAAqB;QAC1C,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;YAE3B,IAAI,WAAW,GAAG,CAAC,CAAA;YAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;gBAE/C,WAAW,EAAE,CAAA;YACd,CAAC;QACF,CAAC;IACF,CAAC;IAEM,QAAQ,CAAC,KAAoB;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAE7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAElB,OAAO,IAAI,CAAA;IACZ,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionClassifier.d.ts","sourceRoot":"","sources":["../../classification/SectionClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"SectionClassifier.d.ts","sourceRoot":"","sources":["../../classification/SectionClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,MAAM,WAAW,sBAAsB;IACtC,qBAAqB,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,EAAE,CAAA;CAC9C;AAED,8BAAsB,iBAAkB,YAAW,UAAU;IAC5D;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAElC,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAM3C,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI;IAQpC;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI;CAKvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionClassifier.js","sourceRoot":"","sources":["../../classification/SectionClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"SectionClassifier.js","sourceRoot":"","sources":["../../classification/SectionClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAQjE,MAAM,OAAgB,iBAAiB;IAMtC,cAAc,CAAC,OAAqB;QACnC,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACxC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACtB,CAAC;IACF,CAAC;IAED,QAAQ,CAAC,KAAoB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAE7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAElB,OAAO,IAAI,CAAA;IACZ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAa,EAAE,KAAW;QACtD,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YACvD,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,KAAK,KAAK,CAAC,CAAA;QACnF,CAAC,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WordClassifier.d.ts","sourceRoot":"","sources":["../../classification/WordClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"WordClassifier.d.ts","sourceRoot":"","sources":["../../classification/WordClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAExE,8BAAsB,cAAe,YAAW,UAAU;IACzD;;;;OAIG;IACI,KAAK,EAAG,WAAW,CAAC,qBAAqB,CAAC,CAAA;IACjD,SAAS,CAAC,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAA;gBAEjC,EAAE,SAAS,EAAE,GAAE,iBAAsB;IAIjD,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAEvE,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAY3C,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI;CAO3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WordClassifier.js","sourceRoot":"","sources":["../../classification/WordClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"WordClassifier.js","sourceRoot":"","sources":["../../classification/WordClassifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAIjE,MAAM,OAAgB,cAAc;IACnC;;;;OAIG;IACI,KAAK,CAAqC;IACvC,SAAS,CAA0B;IAE7C,YAAY,EAAE,SAAS,KAAwB,EAAE;QAChD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,CAAC;IAIM,cAAc,CAAC,OAAqB;QAC1C,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YAClE,IAAI,UAAU,GAAG,CAAC,CAAA;YAElB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACtC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,CAAA;gBAE7C,UAAU,EAAE,CAAA;YACb,CAAC;QACF,CAAC;IACF,CAAC;IAEM,QAAQ,CAAC,KAAoB;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAE7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAElB,OAAO,IAAI,CAAA;IACZ,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../classification/scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../classification/scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,cAAc,CAAC,EAAE,cAAc,CAAA;IAE/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IAEH,MAAM,EAAE,wBAAwB,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;IAE/B;;OAEG;IACH,EAAE,EAAE,cAAc,EAAE,CAAA;IAEpB;;OAEG;IACH,GAAG,CAAC,EAAE,cAAc,EAAE,CAAA;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,wBAAwB,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO,CA8BhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheme.js","sourceRoot":"","sources":["../../classification/scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"scheme.js","sourceRoot":"","sources":["../../classification/scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8CH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,EAAE,EAAE,GAAG,EAA4B,EAAE,MAAY;IACtF,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IAE3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAA;IAEpC,sEAAsE;IACtE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QACrC,8BAA8B;QAC9B,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;QAErC,kFAAkF;QAClF,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAC9C,OAAO,KAAK,CAAA;QACb,CAAC;IACF,CAAC;IAED,gCAAgC;IAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAEpC,iEAAiE;IACjE,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAEjD,8EAA8E;IAC9E,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAC9C,OAAO,KAAK,CAAA;QACb,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
|
@@ -21,10 +21,9 @@ export interface CoarsePlacerArtifact {
|
|
|
21
21
|
weights: Float32Array;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* On-disk `meta.json` shape. The fp32 artifact omits `quantization`/`scales`; the int8 artifact
|
|
25
|
-
*
|
|
26
|
-
* `
|
|
27
|
-
* scales[class]`.
|
|
24
|
+
* On-disk `meta.json` shape. The fp32 artifact omits `quantization`/`scales`; the int8 artifact (from
|
|
25
|
+
* `scripts/coarse-placer/quantize.mjs`) sets `quantization: "int8-per-row"` and carries one `scale` per class, so
|
|
26
|
+
* `weights.bin` can be a 4×-smaller `Int8Array` dequantized as `int8 * scales[class]`.
|
|
28
27
|
*/
|
|
29
28
|
export interface CoarsePlacerMeta {
|
|
30
29
|
classes: string[];
|
|
@@ -36,9 +35,9 @@ export interface CoarsePlacerMeta {
|
|
|
36
35
|
scales?: number[];
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
|
-
* Dequantize a per-row int8 weight matrix back to fp32: `W[c][i] = int8[c*dim + i] * scales[c]`.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* Dequantize a per-row int8 weight matrix back to fp32: `W[c][i] = int8[c*dim + i] * scales[c]`. The predict path stays
|
|
39
|
+
* fp32 (identical math); quantization only shrinks the serialized/wire artifact. Pure — usable in the browser loader
|
|
40
|
+
* too.
|
|
42
41
|
*/
|
|
43
42
|
export declare function dequantizeInt8Weights(int8: Int8Array, scales: readonly number[], classCount: number, dim: number): Float32Array;
|
|
44
43
|
export interface CoarsePrediction {
|
|
@@ -54,16 +53,14 @@ export interface CoarsePlacerOpts {
|
|
|
54
53
|
/** Abstain when the calibrated top-class confidence is below this (default 0.5). */
|
|
55
54
|
abstainBelow?: number;
|
|
56
55
|
/**
|
|
57
|
-
* Open-set reject rule (#244 M2). When `true`, the ABSTAIN decision uses the total IN-MAP
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* the routed in-map country's marginal probability (the soft-prior posterior weight). Default
|
|
66
|
-
* `false` = the M1 max-prob rule (byte-stable; can still return `OTHER`).
|
|
56
|
+
* Open-set reject rule (#244 M2). When `true`, the ABSTAIN decision uses the total IN-MAP probability mass `1 -
|
|
57
|
+
* P(OTHER)` instead of the single top-class prob, and a KEEP routes to the argmax IN-MAP class (never `OTHER`). This
|
|
58
|
+
* decouples "is it in-map at all?" (the reject question) from "which country?" (the routing question) — so a
|
|
59
|
+
* clearly-in-map-but-country-ambiguous address (mass split across several in-map countries) is KEPT rather than
|
|
60
|
+
* wrongly rejected. It clears the 90/90 the default max-prob rule cannot (post-hoc, no retrain: heldout-family
|
|
61
|
+
* generalization 89→91 — see docs/articles/evals/2026-06-14-coarse-placer-m2-openset.md). The returned `confidence`
|
|
62
|
+
* becomes the routed in-map country's marginal probability (the soft-prior posterior weight). Default `false` = the
|
|
63
|
+
* M1 max-prob rule (byte-stable; can still return `OTHER`).
|
|
67
64
|
*/
|
|
68
65
|
openSet?: boolean;
|
|
69
66
|
}
|
|
@@ -72,32 +69,29 @@ export declare class CoarsePlacer {
|
|
|
72
69
|
constructor(artifact: CoarsePlacerArtifact, opts?: CoarsePlacerOpts);
|
|
73
70
|
/**
|
|
74
71
|
* Load a placer from an artifact directory holding `meta.json` + `weights.bin` (the layout
|
|
75
|
-
* `scripts/coarse-placer/train.mjs` and `quantize.mjs` write). Handles both the fp32 artifact
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
72
|
+
* `scripts/coarse-placer/train.mjs` and `quantize.mjs` write). Handles both the fp32 artifact (`weights.bin` is a
|
|
73
|
+
* `Float32Array`) and the int8 artifact (`meta.quantization === "int8-per-row"`, `weights.bin` is an `Int8Array`
|
|
74
|
+
* dequantized via `meta.scales`). Node-only — the `node:` imports are dynamic so bundling the class for the browser
|
|
75
|
+
* doesn't pull them in.
|
|
79
76
|
*/
|
|
80
77
|
static fromArtifactDir(dir: string, opts?: CoarsePlacerOpts): Promise<CoarsePlacer>;
|
|
81
78
|
/**
|
|
82
|
-
* Load the int8 model bundled in `@mailwoman/core` (`core/data/coarse-placer/`). Node-only — uses
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* soft-country-prior wiring passes 0.9 — see
|
|
79
|
+
* Load the int8 model bundled in `@mailwoman/core` (`core/data/coarse-placer/`). Node-only — uses the package path
|
|
80
|
+
* builder (the #481-corrected `__isCompiledTree` makes this resolve to the shipped `data/` in source, compiled, AND
|
|
81
|
+
* installed-package layouts). Override the directory with `$MAILWOMAN_COARSE_PLACER_DIR`. Callers set `abstainBelow`
|
|
82
|
+
* per their use (the soft-country-prior wiring passes 0.9 — see
|
|
87
83
|
* docs/articles/plan/2026-06-14-coarse-placer-soft-signal-spec.md).
|
|
88
84
|
*/
|
|
89
85
|
static fromBundled(opts?: CoarsePlacerOpts): Promise<CoarsePlacer>;
|
|
90
86
|
predict(text: string): CoarsePrediction;
|
|
91
87
|
}
|
|
92
88
|
/**
|
|
93
|
-
* The in-map posterior for the soft-prior DISTRIBUTION wiring (#244 residual upgrade): the
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* the in-map mass `1 - P(OTHER)`), matching the one-hot's `confidence` scale so `anchorWeight` is
|
|
100
|
-
* unchanged.
|
|
89
|
+
* The in-map posterior for the soft-prior DISTRIBUTION wiring (#244 residual upgrade): the per-in-map-country marginals
|
|
90
|
+
* (every class except `OTHER`) from a prediction, or `null` when the model abstained / routed off-map. Fed straight to
|
|
91
|
+
* the resolver's `anchorPosterior` so it boosts EVERY plausible in-map country proportionally — and breaks
|
|
92
|
+
* country-ambiguous ties (mass split across several in-map countries) with its own place-level evidence — instead of
|
|
93
|
+
* committing to the single argmax (the one-hot the M2 wiring shipped). Raw marginals (un-renormalized; they sum to the
|
|
94
|
+
* in-map mass `1 - P(OTHER)`), matching the one-hot's `confidence` scale so `anchorWeight` is unchanged.
|
|
101
95
|
*/
|
|
102
96
|
export declare function inMapPosterior(prediction: CoarsePrediction): Record<string, number> | null;
|
|
103
97
|
/** Load a coarse-placer from a JSON metadata file + a sibling `.weights.bin` (Float32). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coarse-placer.d.ts","sourceRoot":"","sources":["../../coarse-placer/coarse-placer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EA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