@mailwoman/core 10.0.0 → 10.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/README.md +2 -2
- package/THIRD_PARTY_NOTICES.md +45 -5
- package/data/PROVENANCE.md +99 -0
- package/data/chromium-i18n/LICENSE +4 -4
- package/data/libpostal/LICENSE +1 -1
- package/data/libpostal/README.md +8 -8
- package/data/libpostal/dictionaries/README.md +8 -8
- package/data/libpostal/dictionaries/all/surnames.txt +6 -6
- package/lib/api/APIClient.ts +184 -115
- package/lib/api/arcgis.ts +10 -8
- package/lib/api/ckan.ts +27 -24
- package/lib/api/clock.ts +30 -13
- package/lib/api/defaults.ts +14 -8
- package/lib/api/disk-storage.ts +84 -75
- package/lib/api/host.ts +21 -11
- package/lib/api/ogc.ts +427 -41
- package/lib/api/paced-client.ts +8 -6
- package/lib/api/pacer.ts +69 -39
- package/lib/api/responses.ts +85 -59
- package/lib/api/retry.ts +71 -71
- package/lib/api/test/clocks.ts +106 -69
- package/lib/api/test/transport.ts +91 -42
- package/lib/{api/index.ts → api.ts} +3 -3
- package/lib/coarse-placer/coarse-placer.ts +63 -77
- package/lib/coarse-placer/featurize.ts +21 -29
- package/lib/coarse-placer/fnv-hash.ts +4 -2
- package/lib/coarse-placer/math.ts +10 -7
- package/lib/crypto/digest.ts +1 -1
- package/lib/crypto/ed25519.ts +22 -18
- package/lib/crypto/node.ts +6 -3
- package/lib/data-root.ts +52 -137
- package/lib/decoder/build-tree.ts +51 -42
- package/lib/decoder/calibration.ts +19 -19
- package/lib/decoder/containment.ts +28 -19
- package/lib/decoder/parse-diff.ts +37 -44
- package/lib/decoder/proposals-to-tree.ts +15 -22
- package/lib/decoder/resolve-proposal-overlaps.ts +11 -45
- package/lib/decoder/serialize/json.ts +34 -23
- package/lib/decoder/serialize/tuples.ts +4 -2
- package/lib/decoder/serialize/xml.ts +66 -46
- package/lib/decoder/tree/shape.ts +38 -36
- package/lib/decoder/tree/walk.ts +58 -30
- package/lib/decoder/types.ts +36 -88
- package/lib/decoder/unknown-spans.ts +15 -16
- package/lib/decoder/validate-tree.ts +26 -28
- package/lib/env/paths.ts +4 -2
- package/lib/env/schema.ts +23 -12
- package/lib/env/utils.ts +5 -7
- package/lib/{env/index.ts → env.ts} +36 -17
- package/lib/errors/schema.ts +7 -5
- package/lib/fs/compression.ts +62 -6
- package/lib/fs/delimited.ts +127 -0
- package/lib/fs/formatters.ts +25 -14
- package/lib/fs/readers/stat.ts +119 -48
- package/lib/fs/readers.ts +30 -18
- package/lib/fs/streams.ts +35 -23
- package/lib/fs/temporary.ts +17 -22
- package/lib/fs/writers.ts +188 -59
- package/lib/fs/zip.ts +79 -57
- package/lib/git.ts +192 -35
- package/lib/hash.ts +38 -13
- package/lib/html/document.ts +56 -32
- package/lib/html/elements.ts +304 -0
- package/lib/html/tables.ts +16 -35
- package/lib/html/text.ts +33 -22
- package/lib/index.ts +5 -6
- package/lib/json.ts +67 -19
- package/lib/layers/build-command.ts +28 -0
- package/lib/layers/coverage.ts +49 -35
- package/lib/layers/feature-count.ts +12 -10
- package/lib/layers/manifest.ts +72 -95
- package/lib/layers/publication.ts +185 -0
- package/lib/layers/schema.ts +61 -33
- package/lib/layers.ts +15 -0
- package/lib/license/configured.ts +2 -2
- package/lib/license/key/file.ts +38 -24
- package/lib/license/{key/index.ts → key.ts} +39 -37
- package/lib/license/obligations.ts +87 -46
- package/lib/license/publication.ts +15 -15
- package/lib/license/record.ts +277 -0
- package/lib/license/register.ts +14 -9
- package/lib/license/stamp.ts +16 -25
- package/lib/license/status.ts +22 -11
- package/lib/{license/index.ts → license.ts} +5 -4
- package/lib/locale/locale.ts +12 -16
- package/lib/locale/profiles/en-us.ts +2 -40
- package/lib/locale/profiles/fr-fr.ts +3 -44
- package/lib/locale/profiles/ja-jp.ts +4 -12
- package/lib/locale/registry.ts +7 -5
- package/lib/locale/zh-cn-units.ts +29 -41
- package/lib/{locale/index.ts → locale.ts} +1 -1
- package/lib/logging/shared.ts +17 -42
- package/lib/module/clean.ts +151 -0
- package/lib/module/compiled-freshness.ts +175 -0
- package/lib/module/file-url.ts +3 -5
- package/lib/module/package-command.ts +44 -0
- package/lib/module/packaged-data.ts +4 -4
- package/lib/module/resolve-from.ts +31 -23
- package/lib/module/resolvers.ts +23 -21
- package/lib/module/runtime.ts +3 -2
- package/lib/module/workspace.ts +106 -0
- package/lib/numeric.ts +14 -9
- package/lib/objects.ts +13 -7
- package/lib/overture-pins.ts +7 -7
- package/lib/paths.ts +72 -66
- package/lib/pipeline/client-result.ts +15 -10
- package/lib/pipeline/preferences.ts +3 -1
- package/lib/pipeline/result.ts +26 -24
- package/lib/pipeline/runtime-pipeline.ts +59 -178
- package/lib/pipeline/span-proposer.ts +81 -141
- package/lib/pipeline/types.ts +138 -242
- package/lib/{pipeline/index.ts → pipeline.ts} +1 -1
- package/lib/policy/defaults.ts +13 -11
- package/lib/policy/policy.ts +12 -21
- package/lib/policy/proposal-collection.ts +5 -18
- package/lib/policy/registry.ts +19 -62
- package/lib/process.ts +65 -46
- package/lib/promises.ts +41 -0
- package/lib/random.ts +75 -43
- package/lib/release-config.ts +76 -21
- package/lib/resolver/authoritative-provider.ts +43 -64
- package/lib/resolver/coverage-facts.ts +39 -23
- package/lib/resolver/fixture-authoritative-provider.ts +22 -19
- package/lib/resolver/lookup-types.ts +110 -58
- package/lib/resolver/postcode-format.ts +73 -43
- package/lib/resolver/referential.ts +57 -35
- package/lib/resolver/region-database-provider.ts +57 -0
- package/lib/resolver/synthetic-id-ranges.ts +17 -11
- package/lib/resolver/types.ts +98 -543
- package/lib/{resolver/index.ts → resolver.ts} +11 -11
- package/lib/resources/git.ts +6 -5
- package/lib/resources/libpostal.ts +3 -4
- package/lib/resources/whosonfirst/PlacetypeDataSource.ts +16 -9
- package/lib/resources/whosonfirst/backoff.ts +2 -5
- package/lib/resources/whosonfirst/extract-repo.ts +34 -25
- package/lib/resources/whosonfirst/placetypes/Placetype.ts +28 -22
- package/lib/resources/whosonfirst/placetypes/admin.ts +20 -11
- package/lib/resources/whosonfirst/placetypes/graph.ts +21 -12
- package/lib/resources/whosonfirst/placetypes/mermaid.ts +21 -31
- package/lib/resources/whosonfirst/placetypes/specificity.ts +31 -38
- package/lib/resources/whosonfirst/placetypes/tree.ts +10 -6
- package/lib/resources/{whosonfirst/index.ts → whosonfirst.ts} +1 -1
- package/lib/{resources/index.ts → resources.ts} +2 -2
- package/lib/{routing/index.ts → routing.ts} +5 -5
- package/lib/scope-config.ts +165 -0
- package/lib/scripting/arguments.ts +79 -35
- package/lib/scripting/command.ts +11 -4
- package/lib/scripting/ingest-chunk-script.ts +20 -22
- package/lib/scripting/operation.ts +102 -0
- package/lib/scripting/{utils/index.ts → utils.ts} +15 -9
- package/lib/{scripting/index.ts → scripting.ts} +8 -5
- package/lib/stats.ts +8 -9
- package/lib/strings/compare.ts +3 -2
- package/lib/strings/escape.ts +1 -1
- package/lib/strings/format.ts +11 -5
- package/lib/strings/markdown-table.ts +50 -0
- package/lib/strings/python-json.ts +14 -11
- package/lib/tokenization/Graph.ts +3 -0
- package/lib/tokenization/Span.ts +7 -4
- package/lib/tokenization/normalizer.ts +16 -13
- package/lib/trust-policies.ts +37 -22
- package/lib/types/Classification.ts +3 -3
- package/lib/types/classifier.ts +47 -49
- package/lib/types/mapping.ts +22 -19
- package/lib/utils/chunk-process.ts +21 -28
- package/lib/utils/collections.ts +4 -2
- package/lib/utils/events.ts +2 -1
- package/lib/utils/geodatabase-archive.ts +28 -31
- package/lib/utils/sleep.ts +2 -2
- package/lib/utils/sqlite-rows.ts +11 -19
- package/lib/utils/stream-to-disk.ts +27 -40
- package/lib/utils/system.ts +14 -2
- package/lib/utils/time.ts +8 -6
- package/lib/utils/union-find.ts +7 -3
- package/lib/{utils/index.ts → utils.ts} +0 -2
- package/lib/vale.ts +41 -29
- package/lib/workspaces.ts +57 -14
- package/out/api/APIClient.d.ts +75 -57
- package/out/api/APIClient.d.ts.map +1 -1
- package/out/api/APIClient.js +133 -84
- package/out/api/APIClient.js.map +1 -1
- package/out/api/arcgis.d.ts +10 -8
- package/out/api/arcgis.d.ts.map +1 -1
- package/out/api/arcgis.js +7 -8
- package/out/api/arcgis.js.map +1 -1
- package/out/api/ckan.d.ts +24 -21
- package/out/api/ckan.d.ts.map +1 -1
- package/out/api/ckan.js +11 -13
- package/out/api/ckan.js.map +1 -1
- package/out/api/clock.d.ts +15 -10
- package/out/api/clock.d.ts.map +1 -1
- package/out/api/clock.js +16 -8
- package/out/api/clock.js.map +1 -1
- package/out/api/defaults.d.ts +14 -8
- package/out/api/defaults.d.ts.map +1 -1
- package/out/api/defaults.js +14 -8
- package/out/api/defaults.js.map +1 -1
- package/out/api/disk-storage.d.ts +44 -33
- package/out/api/disk-storage.d.ts.map +1 -1
- package/out/api/disk-storage.js +70 -67
- package/out/api/disk-storage.js.map +1 -1
- package/out/api/host.d.ts +18 -10
- package/out/api/host.d.ts.map +1 -1
- package/out/api/host.js +15 -8
- package/out/api/host.js.map +1 -1
- package/out/api/ogc.d.ts +140 -20
- package/out/api/ogc.d.ts.map +1 -1
- package/out/api/ogc.js +327 -38
- package/out/api/ogc.js.map +1 -1
- package/out/api/paced-client.d.ts +7 -5
- package/out/api/paced-client.d.ts.map +1 -1
- package/out/api/paced-client.js +6 -5
- package/out/api/paced-client.js.map +1 -1
- package/out/api/pacer.d.ts +64 -38
- package/out/api/pacer.d.ts.map +1 -1
- package/out/api/pacer.js +67 -39
- package/out/api/pacer.js.map +1 -1
- package/out/api/responses.d.ts +65 -43
- package/out/api/responses.d.ts.map +1 -1
- package/out/api/responses.js +85 -59
- package/out/api/responses.js.map +1 -1
- package/out/api/retry.d.ts +61 -55
- package/out/api/retry.d.ts.map +1 -1
- package/out/api/retry.js +46 -58
- package/out/api/retry.js.map +1 -1
- package/out/api/test/clocks.d.ts +67 -41
- package/out/api/test/clocks.d.ts.map +1 -1
- package/out/api/test/clocks.js +100 -67
- package/out/api/test/clocks.js.map +1 -1
- package/out/api/test/transport.d.ts +66 -36
- package/out/api/test/transport.d.ts.map +1 -1
- package/out/api/test/transport.js +56 -26
- package/out/api/test/transport.js.map +1 -1
- package/out/{api/index.d.ts → api.d.ts} +1 -1
- package/out/api.d.ts.map +1 -0
- package/out/{api/index.js → api.js} +4 -4
- package/out/api.js.map +1 -0
- package/out/coarse-placer/coarse-placer.d.ts +53 -64
- package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
- package/out/coarse-placer/coarse-placer.js +31 -46
- package/out/coarse-placer/coarse-placer.js.map +1 -1
- package/out/coarse-placer/featurize.d.ts +21 -25
- package/out/coarse-placer/featurize.d.ts.map +1 -1
- package/out/coarse-placer/featurize.js +21 -29
- package/out/coarse-placer/featurize.js.map +1 -1
- package/out/coarse-placer/fnv-hash.d.ts +4 -2
- package/out/coarse-placer/fnv-hash.d.ts.map +1 -1
- package/out/coarse-placer/fnv-hash.js +4 -2
- package/out/coarse-placer/fnv-hash.js.map +1 -1
- package/out/coarse-placer/math.d.ts +10 -7
- package/out/coarse-placer/math.d.ts.map +1 -1
- package/out/coarse-placer/math.js +10 -7
- package/out/coarse-placer/math.js.map +1 -1
- package/out/crypto/digest.d.ts +1 -1
- package/out/crypto/digest.js +1 -1
- package/out/crypto/ed25519.d.ts +14 -12
- package/out/crypto/ed25519.d.ts.map +1 -1
- package/out/crypto/ed25519.js +22 -18
- package/out/crypto/ed25519.js.map +1 -1
- package/out/crypto/node.d.ts +6 -3
- package/out/crypto/node.d.ts.map +1 -1
- package/out/crypto/node.js +2 -1
- package/out/crypto/node.js.map +1 -1
- package/out/data-root.d.ts +46 -94
- package/out/data-root.d.ts.map +1 -1
- package/out/data-root.js +51 -90
- package/out/data-root.js.map +1 -1
- package/out/decoder/build-tree.d.ts +18 -12
- package/out/decoder/build-tree.d.ts.map +1 -1
- package/out/decoder/build-tree.js +36 -33
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/calibration.d.ts +18 -16
- package/out/decoder/calibration.d.ts.map +1 -1
- package/out/decoder/calibration.js +19 -19
- package/out/decoder/calibration.js.map +1 -1
- package/out/decoder/containment.d.ts +13 -8
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js +28 -19
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/parse-diff.d.ts +31 -35
- package/out/decoder/parse-diff.d.ts.map +1 -1
- package/out/decoder/parse-diff.js +23 -36
- package/out/decoder/parse-diff.js.map +1 -1
- package/out/decoder/proposals-to-tree.d.ts +14 -21
- package/out/decoder/proposals-to-tree.d.ts.map +1 -1
- package/out/decoder/proposals-to-tree.js +12 -19
- package/out/decoder/proposals-to-tree.js.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.d.ts +6 -39
- package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.js +10 -44
- package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
- package/out/decoder/serialize/json.d.ts +26 -16
- package/out/decoder/serialize/json.d.ts.map +1 -1
- package/out/decoder/serialize/json.js +15 -12
- package/out/decoder/serialize/json.js.map +1 -1
- package/out/decoder/serialize/tuples.d.ts +4 -2
- package/out/decoder/serialize/tuples.d.ts.map +1 -1
- package/out/decoder/serialize/tuples.js.map +1 -1
- package/out/decoder/serialize/xml.d.ts +47 -35
- package/out/decoder/serialize/xml.d.ts.map +1 -1
- package/out/decoder/serialize/xml.js +36 -32
- package/out/decoder/serialize/xml.js.map +1 -1
- package/out/decoder/tree/shape.d.ts +38 -36
- package/out/decoder/tree/shape.d.ts.map +1 -1
- package/out/decoder/tree/shape.js +23 -27
- package/out/decoder/tree/shape.js.map +1 -1
- package/out/decoder/tree/walk.d.ts +43 -26
- package/out/decoder/tree/walk.d.ts.map +1 -1
- package/out/decoder/tree/walk.js +53 -28
- package/out/decoder/tree/walk.js.map +1 -1
- package/out/decoder/types.d.ts +36 -88
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +1 -21
- package/out/decoder/types.js.map +1 -1
- package/out/decoder/unknown-spans.d.ts +9 -6
- package/out/decoder/unknown-spans.d.ts.map +1 -1
- package/out/decoder/unknown-spans.js +15 -16
- package/out/decoder/unknown-spans.js.map +1 -1
- package/out/decoder/validate-tree.d.ts +22 -19
- package/out/decoder/validate-tree.d.ts.map +1 -1
- package/out/decoder/validate-tree.js +22 -21
- package/out/decoder/validate-tree.js.map +1 -1
- package/out/{decoder/index.js → decoder.d.ts} +1 -1
- package/out/decoder.d.ts.map +1 -0
- package/out/{decoder/index.d.ts → decoder.js} +1 -1
- package/out/decoder.js.map +1 -0
- package/out/env/paths.d.ts +4 -2
- package/out/env/paths.d.ts.map +1 -1
- package/out/env/paths.js +4 -2
- package/out/env/paths.js.map +1 -1
- package/out/env/schema.d.ts +7 -4
- package/out/env/schema.d.ts.map +1 -1
- package/out/env/schema.js +23 -12
- package/out/env/schema.js.map +1 -1
- package/out/env/utils.d.ts +5 -7
- package/out/env/utils.d.ts.map +1 -1
- package/out/env/utils.js +5 -7
- package/out/env/utils.js.map +1 -1
- package/out/{env/index.d.ts → env.d.ts} +26 -11
- package/out/env.d.ts.map +1 -0
- package/out/{env/index.js → env.js} +37 -18
- package/out/env.js.map +1 -0
- package/out/errors/schema.d.ts +7 -5
- package/out/errors/schema.d.ts.map +1 -1
- package/out/errors/schema.js +7 -5
- package/out/errors/schema.js.map +1 -1
- package/out/fs/compression.d.ts +35 -2
- package/out/fs/compression.d.ts.map +1 -1
- package/out/fs/compression.js +44 -6
- package/out/fs/compression.js.map +1 -1
- package/out/fs/delimited.d.ts +68 -0
- package/out/fs/delimited.d.ts.map +1 -0
- package/out/fs/delimited.js +108 -0
- package/out/fs/delimited.js.map +1 -0
- package/out/fs/formatters.d.ts +25 -14
- package/out/fs/formatters.d.ts.map +1 -1
- package/out/fs/formatters.js +21 -12
- package/out/fs/formatters.js.map +1 -1
- package/out/fs/readers/stat.d.ts +43 -35
- package/out/fs/readers/stat.d.ts.map +1 -1
- package/out/fs/readers/stat.js +93 -39
- package/out/fs/readers/stat.js.map +1 -1
- package/out/fs/readers.d.ts +24 -15
- package/out/fs/readers.d.ts.map +1 -1
- package/out/fs/readers.js +27 -16
- package/out/fs/readers.js.map +1 -1
- package/out/fs/streams.d.ts +35 -23
- package/out/fs/streams.d.ts.map +1 -1
- package/out/fs/streams.js +35 -23
- package/out/fs/streams.js.map +1 -1
- package/out/fs/temporary.d.ts +12 -15
- package/out/fs/temporary.d.ts.map +1 -1
- package/out/fs/temporary.js +6 -8
- package/out/fs/temporary.js.map +1 -1
- package/out/fs/writers.d.ts +90 -48
- package/out/fs/writers.d.ts.map +1 -1
- package/out/fs/writers.js +131 -63
- package/out/fs/writers.js.map +1 -1
- package/out/fs/zip.d.ts +55 -37
- package/out/fs/zip.d.ts.map +1 -1
- package/out/fs/zip.js +55 -46
- package/out/fs/zip.js.map +1 -1
- package/out/git.d.ts +94 -22
- package/out/git.d.ts.map +1 -1
- package/out/git.js +145 -35
- package/out/git.js.map +1 -1
- package/out/hash.d.ts +34 -13
- package/out/hash.d.ts.map +1 -1
- package/out/hash.js +33 -11
- package/out/hash.js.map +1 -1
- package/out/html/document.d.ts +45 -26
- package/out/html/document.d.ts.map +1 -1
- package/out/html/document.js +38 -23
- package/out/html/document.js.map +1 -1
- package/out/html/elements.d.ts +113 -0
- package/out/html/elements.d.ts.map +1 -0
- package/out/html/elements.js +204 -0
- package/out/html/elements.js.map +1 -0
- package/out/html/tables.d.ts +12 -25
- package/out/html/tables.d.ts.map +1 -1
- package/out/html/tables.js +13 -31
- package/out/html/tables.js.map +1 -1
- package/out/html/text.d.ts +35 -24
- package/out/html/text.d.ts.map +1 -1
- package/out/html/text.js +33 -22
- package/out/html/text.js.map +1 -1
- package/out/index.d.ts +5 -6
- package/out/index.d.ts.map +1 -1
- package/out/index.js +5 -6
- package/out/index.js.map +1 -1
- package/out/json.d.ts +59 -15
- package/out/json.d.ts.map +1 -1
- package/out/json.js +53 -13
- package/out/json.js.map +1 -1
- package/out/layers/build-command.d.ts +21 -0
- package/out/layers/build-command.d.ts.map +1 -0
- package/out/layers/build-command.js +26 -0
- package/out/layers/build-command.js.map +1 -0
- package/out/layers/coverage.d.ts +47 -31
- package/out/layers/coverage.d.ts.map +1 -1
- package/out/layers/coverage.js +38 -29
- package/out/layers/coverage.js.map +1 -1
- package/out/layers/feature-count.d.ts +12 -10
- package/out/layers/feature-count.d.ts.map +1 -1
- package/out/layers/feature-count.js +7 -7
- package/out/layers/feature-count.js.map +1 -1
- package/out/layers/manifest.d.ts +50 -79
- package/out/layers/manifest.d.ts.map +1 -1
- package/out/layers/manifest.js +36 -69
- package/out/layers/manifest.js.map +1 -1
- package/out/layers/publication.d.ts +89 -0
- package/out/layers/publication.d.ts.map +1 -0
- package/out/layers/publication.js +118 -0
- package/out/layers/publication.js.map +1 -0
- package/out/layers/schema.d.ts +52 -28
- package/out/layers/schema.d.ts.map +1 -1
- package/out/layers/schema.js +22 -15
- package/out/layers/schema.js.map +1 -1
- package/out/layers.d.ts +15 -0
- package/out/layers.d.ts.map +1 -0
- package/out/layers.js +15 -0
- package/out/layers.js.map +1 -0
- package/out/license/configured.d.ts +2 -2
- package/out/license/configured.d.ts.map +1 -1
- package/out/license/configured.js +2 -2
- package/out/license/configured.js.map +1 -1
- package/out/license/key/file.d.ts +31 -14
- package/out/license/key/file.d.ts.map +1 -1
- package/out/license/key/file.js +36 -22
- package/out/license/key/file.js.map +1 -1
- package/out/license/key.d.ts +98 -0
- package/out/license/key.d.ts.map +1 -0
- package/out/license/{key/index.js → key.js} +33 -35
- package/out/license/key.js.map +1 -0
- package/out/license/obligations.d.ts +44 -32
- package/out/license/obligations.d.ts.map +1 -1
- package/out/license/obligations.js +71 -39
- package/out/license/obligations.js.map +1 -1
- package/out/license/publication.d.ts +10 -10
- package/out/license/publication.d.ts.map +1 -1
- package/out/license/publication.js +10 -11
- package/out/license/publication.js.map +1 -1
- package/out/license/record.d.ts +139 -0
- package/out/license/record.d.ts.map +1 -0
- package/out/license/record.js +223 -0
- package/out/license/record.js.map +1 -0
- package/out/license/register.d.ts +14 -9
- package/out/license/register.d.ts.map +1 -1
- package/out/license/register.js +12 -8
- package/out/license/register.js.map +1 -1
- package/out/license/stamp.d.ts +14 -23
- package/out/license/stamp.d.ts.map +1 -1
- package/out/license/stamp.js +12 -18
- package/out/license/stamp.js.map +1 -1
- package/out/license/status.d.ts +17 -8
- package/out/license/status.d.ts.map +1 -1
- package/out/license/status.js +22 -11
- package/out/license/status.js.map +1 -1
- package/out/{license/index.js → license.d.ts} +6 -5
- package/out/license.d.ts.map +1 -0
- package/out/{license/index.d.ts → license.js} +6 -5
- package/out/license.js.map +1 -0
- package/out/locale/locale.d.ts +12 -15
- package/out/locale/locale.d.ts.map +1 -1
- package/out/locale/locale.js +5 -7
- package/out/locale/locale.js.map +1 -1
- package/out/locale/profiles/en-us.d.ts +2 -3
- package/out/locale/profiles/en-us.d.ts.map +1 -1
- package/out/locale/profiles/en-us.js +2 -40
- package/out/locale/profiles/en-us.js.map +1 -1
- package/out/locale/profiles/fr-fr.d.ts +3 -6
- package/out/locale/profiles/fr-fr.d.ts.map +1 -1
- package/out/locale/profiles/fr-fr.js +3 -44
- package/out/locale/profiles/fr-fr.js.map +1 -1
- package/out/locale/profiles/ja-jp.d.ts +2 -9
- package/out/locale/profiles/ja-jp.d.ts.map +1 -1
- package/out/locale/profiles/ja-jp.js +4 -12
- package/out/locale/profiles/ja-jp.js.map +1 -1
- package/out/locale/{profiles/index.js → profiles.d.ts} +1 -1
- package/out/locale/profiles.d.ts.map +1 -0
- package/out/locale/{profiles/index.d.ts → profiles.js} +1 -1
- package/out/locale/profiles.js.map +1 -0
- package/out/locale/registry.d.ts +4 -3
- package/out/locale/registry.d.ts.map +1 -1
- package/out/locale/registry.js +7 -5
- package/out/locale/registry.js.map +1 -1
- package/out/locale/zh-cn-units.d.ts +22 -30
- package/out/locale/zh-cn-units.d.ts.map +1 -1
- package/out/locale/zh-cn-units.js +27 -34
- package/out/locale/zh-cn-units.js.map +1 -1
- package/out/{locale/index.js → locale.d.ts} +2 -2
- package/out/locale.d.ts.map +1 -0
- package/out/{locale/index.d.ts → locale.js} +2 -2
- package/out/locale.js.map +1 -0
- package/out/logging/shared.d.ts +5 -22
- package/out/logging/shared.d.ts.map +1 -1
- package/out/logging/shared.js +17 -42
- package/out/logging/shared.js.map +1 -1
- package/out/{logging/index.d.ts → logging.d.ts} +1 -1
- package/out/logging.d.ts.map +1 -0
- package/out/{logging/index.js → logging.js} +1 -1
- package/out/logging.js.map +1 -0
- package/out/module/clean.d.ts +56 -0
- package/out/module/clean.d.ts.map +1 -0
- package/out/module/clean.js +84 -0
- package/out/module/clean.js.map +1 -0
- package/out/module/compiled-freshness.d.ts +43 -0
- package/out/module/compiled-freshness.d.ts.map +1 -0
- package/out/module/compiled-freshness.js +118 -0
- package/out/module/compiled-freshness.js.map +1 -0
- package/out/module/file-url.d.ts +3 -5
- package/out/module/file-url.d.ts.map +1 -1
- package/out/module/file-url.js +3 -5
- package/out/module/file-url.js.map +1 -1
- package/out/module/package-command.d.ts +20 -0
- package/out/module/package-command.d.ts.map +1 -0
- package/out/module/package-command.js +27 -0
- package/out/module/package-command.js.map +1 -0
- package/out/module/packaged-data.d.ts +4 -4
- package/out/module/packaged-data.js +4 -4
- package/out/module/resolve-from.d.ts +23 -20
- package/out/module/resolve-from.d.ts.map +1 -1
- package/out/module/resolve-from.js +19 -16
- package/out/module/resolve-from.js.map +1 -1
- package/out/module/resolvers.d.ts +23 -21
- package/out/module/resolvers.d.ts.map +1 -1
- package/out/module/resolvers.js +23 -21
- package/out/module/resolvers.js.map +1 -1
- package/out/module/runtime.d.ts +3 -2
- package/out/module/runtime.d.ts.map +1 -1
- package/out/module/runtime.js +3 -2
- package/out/module/runtime.js.map +1 -1
- package/out/module/workspace.d.ts +43 -0
- package/out/module/workspace.d.ts.map +1 -0
- package/out/module/workspace.js +79 -0
- package/out/module/workspace.js.map +1 -0
- package/out/numeric.d.ts +7 -5
- package/out/numeric.d.ts.map +1 -1
- package/out/numeric.js +14 -9
- package/out/numeric.js.map +1 -1
- package/out/objects.d.ts +13 -7
- package/out/objects.d.ts.map +1 -1
- package/out/objects.js +7 -3
- package/out/objects.js.map +1 -1
- package/out/overture-pins.d.ts +7 -7
- package/out/overture-pins.js +7 -7
- package/out/paths.d.ts +27 -36
- package/out/paths.d.ts.map +1 -1
- package/out/paths.js +66 -55
- package/out/paths.js.map +1 -1
- package/out/pipeline/client-result.d.ts +15 -10
- package/out/pipeline/client-result.d.ts.map +1 -1
- package/out/pipeline/client-result.js +4 -4
- package/out/pipeline/preferences.d.ts +3 -1
- package/out/pipeline/preferences.d.ts.map +1 -1
- package/out/pipeline/result.d.ts +26 -24
- package/out/pipeline/result.d.ts.map +1 -1
- package/out/pipeline/result.js +0 -1
- package/out/pipeline/result.js.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +21 -75
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +59 -178
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-proposer.d.ts +36 -74
- package/out/pipeline/span-proposer.d.ts.map +1 -1
- package/out/pipeline/span-proposer.js +49 -100
- package/out/pipeline/span-proposer.js.map +1 -1
- package/out/pipeline/types.d.ts +148 -242
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +16 -45
- package/out/pipeline/types.js.map +1 -1
- package/out/{pipeline/index.d.ts → pipeline.d.ts} +2 -2
- package/out/pipeline.d.ts.map +1 -0
- package/out/{pipeline/index.js → pipeline.js} +2 -2
- package/out/pipeline.js.map +1 -0
- package/out/policy/defaults.d.ts +11 -9
- package/out/policy/defaults.d.ts.map +1 -1
- package/out/policy/defaults.js +13 -11
- package/out/policy/defaults.js.map +1 -1
- package/out/policy/policy.d.ts +12 -21
- package/out/policy/policy.d.ts.map +1 -1
- package/out/policy/policy.js +1 -4
- package/out/policy/policy.js.map +1 -1
- package/out/policy/proposal-collection.d.ts +5 -18
- package/out/policy/proposal-collection.d.ts.map +1 -1
- package/out/policy/proposal-collection.js +4 -17
- package/out/policy/proposal-collection.js.map +1 -1
- package/out/policy/registry.d.ts +11 -6
- package/out/policy/registry.d.ts.map +1 -1
- package/out/policy/registry.js +19 -47
- package/out/policy/registry.js.map +1 -1
- package/out/{policy/index.d.ts → policy.d.ts} +1 -1
- package/out/policy.d.ts.map +1 -0
- package/out/{policy/index.js → policy.js} +1 -1
- package/out/policy.js.map +1 -0
- package/out/process.d.ts +32 -33
- package/out/process.d.ts.map +1 -1
- package/out/process.js +20 -22
- package/out/process.js.map +1 -1
- package/out/promises.d.ts +20 -0
- package/out/promises.d.ts.map +1 -0
- package/out/promises.js +27 -0
- package/out/promises.js.map +1 -0
- package/out/random.d.ts +40 -36
- package/out/random.d.ts.map +1 -1
- package/out/random.js +66 -43
- package/out/random.js.map +1 -1
- package/out/release-config.d.ts +51 -20
- package/out/release-config.d.ts.map +1 -1
- package/out/release-config.js +41 -11
- package/out/release-config.js.map +1 -1
- package/out/resolver/authoritative-provider.d.ts +43 -64
- package/out/resolver/authoritative-provider.d.ts.map +1 -1
- package/out/resolver/authoritative-provider.js +15 -23
- package/out/resolver/authoritative-provider.js.map +1 -1
- package/out/resolver/coverage-facts.d.ts +39 -23
- package/out/resolver/coverage-facts.d.ts.map +1 -1
- package/out/resolver/coverage-facts.js +6 -4
- package/out/resolver/coverage-facts.js.map +1 -1
- package/out/resolver/fixture-authoritative-provider.d.ts +22 -19
- package/out/resolver/fixture-authoritative-provider.d.ts.map +1 -1
- package/out/resolver/fixture-authoritative-provider.js +14 -13
- package/out/resolver/fixture-authoritative-provider.js.map +1 -1
- package/out/resolver/lookup-types.d.ts +110 -58
- package/out/resolver/lookup-types.d.ts.map +1 -1
- package/out/resolver/lookup-types.js +5 -3
- package/out/resolver/lookup-types.js.map +1 -1
- package/out/resolver/postcode-format.d.ts +25 -25
- package/out/resolver/postcode-format.d.ts.map +1 -1
- package/out/resolver/postcode-format.js +69 -43
- package/out/resolver/postcode-format.js.map +1 -1
- package/out/resolver/referential.d.ts +57 -35
- package/out/resolver/referential.d.ts.map +1 -1
- package/out/resolver/referential.js +51 -33
- package/out/resolver/referential.js.map +1 -1
- package/out/resolver/region-database-provider.d.ts +51 -0
- package/out/resolver/region-database-provider.d.ts.map +1 -0
- package/out/resolver/region-database-provider.js +8 -0
- package/out/resolver/region-database-provider.js.map +1 -0
- package/out/resolver/synthetic-id-ranges.d.ts +17 -11
- package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
- package/out/resolver/synthetic-id-ranges.js +17 -11
- package/out/resolver/synthetic-id-ranges.js.map +1 -1
- package/out/resolver/types.d.ts +98 -542
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +0 -12
- package/out/resolver/types.js.map +1 -1
- package/out/{resolver/index.d.ts → resolver.d.ts} +11 -9
- package/out/resolver.d.ts.map +1 -0
- package/out/resolver.js +19 -0
- package/out/resolver.js.map +1 -0
- package/out/resources/git.d.ts +3 -2
- package/out/resources/git.d.ts.map +1 -1
- package/out/resources/git.js +3 -3
- package/out/resources/git.js.map +1 -1
- package/out/resources/{languages/index.d.ts → languages.d.ts} +1 -1
- package/out/resources/languages.d.ts.map +1 -0
- package/out/resources/{languages/index.js → languages.js} +1 -1
- package/out/resources/languages.js.map +1 -0
- package/out/resources/libpostal.d.ts +3 -4
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/libpostal.js +3 -4
- package/out/resources/libpostal.js.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +7 -3
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js +9 -6
- package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
- package/out/resources/whosonfirst/backoff.d.ts +1 -4
- package/out/resources/whosonfirst/backoff.d.ts.map +1 -1
- package/out/resources/whosonfirst/backoff.js +2 -5
- package/out/resources/whosonfirst/backoff.js.map +1 -1
- package/out/resources/whosonfirst/extract-repo.d.ts +26 -18
- package/out/resources/whosonfirst/extract-repo.d.ts.map +1 -1
- package/out/resources/whosonfirst/extract-repo.js +33 -24
- package/out/resources/whosonfirst/extract-repo.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts +9 -6
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.js +28 -22
- package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +20 -11
- package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.js +4 -2
- package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.d.ts +21 -12
- package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.js +9 -6
- package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts +14 -21
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js +13 -21
- package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/specificity.d.ts +31 -38
- package/out/resources/whosonfirst/placetypes/specificity.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/specificity.js +31 -38
- package/out/resources/whosonfirst/placetypes/specificity.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.d.ts +10 -6
- package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.js +6 -3
- package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
- package/out/resources/whosonfirst/{placetypes/index.js → placetypes.d.ts} +1 -1
- package/out/resources/whosonfirst/placetypes.d.ts.map +1 -0
- package/out/resources/whosonfirst/{placetypes/index.d.ts → placetypes.js} +1 -1
- package/out/resources/whosonfirst/placetypes.js.map +1 -0
- package/out/resources/{whosonfirst/index.d.ts → whosonfirst.d.ts} +2 -2
- package/out/resources/whosonfirst.d.ts.map +1 -0
- package/out/resources/{whosonfirst/index.js → whosonfirst.js} +2 -2
- package/out/resources/whosonfirst.js.map +1 -0
- package/out/{resources/index.js → resources.d.ts} +3 -3
- package/out/resources.d.ts.map +1 -0
- package/out/{resources/index.d.ts → resources.js} +3 -3
- package/out/resources.js.map +1 -0
- package/out/{routing/index.d.ts → routing.d.ts} +1 -1
- package/out/routing.d.ts.map +1 -0
- package/out/{routing/index.js → routing.js} +4 -4
- package/out/routing.js.map +1 -0
- package/out/scope-config.d.ts +108 -0
- package/out/scope-config.d.ts.map +1 -0
- package/out/scope-config.js +85 -0
- package/out/scope-config.js.map +1 -0
- package/out/scripting/arguments.d.ts +50 -14
- package/out/scripting/arguments.d.ts.map +1 -1
- package/out/scripting/arguments.js +52 -36
- package/out/scripting/arguments.js.map +1 -1
- package/out/scripting/command.d.ts +10 -2
- package/out/scripting/command.d.ts.map +1 -1
- package/out/scripting/command.js +3 -1
- package/out/scripting/command.js.map +1 -1
- package/out/scripting/ingest-chunk-script.d.ts +16 -17
- package/out/scripting/ingest-chunk-script.d.ts.map +1 -1
- package/out/scripting/ingest-chunk-script.js +16 -18
- package/out/scripting/ingest-chunk-script.js.map +1 -1
- package/out/scripting/operation.d.ts +77 -0
- package/out/scripting/operation.d.ts.map +1 -0
- package/out/scripting/operation.js +38 -0
- package/out/scripting/operation.js.map +1 -0
- package/out/scripting/{utils/index.d.ts → utils.d.ts} +14 -9
- package/out/scripting/utils.d.ts.map +1 -0
- package/out/scripting/{utils/index.js → utils.js} +16 -10
- package/out/scripting/utils.js.map +1 -0
- package/out/{scripting/index.d.ts → scripting.d.ts} +6 -4
- package/out/scripting.d.ts.map +1 -0
- package/out/{scripting/index.js → scripting.js} +7 -5
- package/out/scripting.js.map +1 -0
- package/out/stats.d.ts +8 -9
- package/out/stats.d.ts.map +1 -1
- package/out/stats.js +8 -9
- package/out/stats.js.map +1 -1
- package/out/strings/compare.d.ts +3 -2
- package/out/strings/compare.d.ts.map +1 -1
- package/out/strings/compare.js +3 -2
- package/out/strings/compare.js.map +1 -1
- package/out/strings/escape.d.ts +1 -1
- package/out/strings/escape.js +1 -1
- package/out/strings/format.d.ts +11 -5
- package/out/strings/format.d.ts.map +1 -1
- package/out/strings/format.js +11 -5
- package/out/strings/format.js.map +1 -1
- package/out/strings/markdown-table.d.ts +22 -0
- package/out/strings/markdown-table.d.ts.map +1 -0
- package/out/strings/markdown-table.js +43 -0
- package/out/strings/markdown-table.js.map +1 -0
- package/out/strings/python-json.d.ts +3 -28
- package/out/strings/python-json.d.ts.map +1 -1
- package/out/strings/python-json.js +13 -11
- package/out/strings/python-json.js.map +1 -1
- package/out/tokenization/Graph.d.ts +3 -0
- package/out/tokenization/Graph.d.ts.map +1 -1
- package/out/tokenization/Graph.js +3 -0
- package/out/tokenization/Graph.js.map +1 -1
- package/out/tokenization/Span.d.ts +4 -1
- package/out/tokenization/Span.d.ts.map +1 -1
- package/out/tokenization/Span.js +6 -3
- package/out/tokenization/Span.js.map +1 -1
- package/out/tokenization/normalizer.d.ts +4 -1
- package/out/tokenization/normalizer.d.ts.map +1 -1
- package/out/tokenization/normalizer.js +16 -13
- package/out/tokenization/normalizer.js.map +1 -1
- package/out/{tokenization/index.js → tokenization.d.ts} +1 -1
- package/out/tokenization.d.ts.map +1 -0
- package/out/{tokenization/index.d.ts → tokenization.js} +1 -1
- package/out/tokenization.js.map +1 -0
- package/out/tools/coarse-placer/build/dataset.d.ts +38 -0
- package/out/tools/coarse-placer/build/dataset.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/build/dataset.js +25 -37
- package/out/tools/coarse-placer/build/dataset.js.map +1 -0
- package/out/tools/coarse-placer/build/outlier/exposure.d.ts +48 -0
- package/out/tools/coarse-placer/build/outlier/exposure.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/build/outlier/exposure.js +45 -33
- package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -0
- package/out/tools/coarse-placer/build/outlier/latin.d.ts +61 -0
- package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/build/outlier/latin.js +29 -29
- package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -0
- package/out/tools/coarse-placer/build/outlier/oa.d.ts +68 -0
- package/out/tools/coarse-placer/build/outlier/oa.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/build/outlier/oa.js +44 -38
- package/out/tools/coarse-placer/build/outlier/oa.js.map +1 -0
- package/out/tools/coarse-placer/country-sets.d.ts +33 -0
- package/out/tools/coarse-placer/country-sets.d.ts.map +1 -0
- package/out/tools/coarse-placer/country-sets.js +50 -0
- package/out/tools/coarse-placer/country-sets.js.map +1 -0
- package/out/tools/coarse-placer/eval/latin-offmap.d.ts +52 -0
- package/out/tools/coarse-placer/eval/latin-offmap.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/eval/latin-offmap.js +10 -8
- package/out/tools/coarse-placer/eval/latin-offmap.js.map +1 -0
- package/out/tools/coarse-placer/eval/openset.d.ts +46 -0
- package/out/tools/coarse-placer/eval/openset.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/eval/openset.js +32 -63
- package/out/tools/coarse-placer/eval/openset.js.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/eval/quant-compare.d.ts +20 -9
- package/out/tools/coarse-placer/eval/quant-compare.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/eval/quant-compare.js +9 -6
- package/out/tools/coarse-placer/eval/quant-compare.js.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/eval.d.ts +17 -8
- package/out/tools/coarse-placer/eval.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/eval.js +14 -13
- package/out/tools/coarse-placer/eval.js.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/outlier-rows.d.ts +10 -8
- package/out/tools/coarse-placer/outlier-rows.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/outlier-rows.js +17 -16
- package/out/tools/coarse-placer/outlier-rows.js.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/paths.d.ts +10 -9
- package/out/tools/coarse-placer/paths.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/paths.js +16 -11
- package/out/tools/coarse-placer/paths.js.map +1 -0
- package/out/tools/coarse-placer/probe-frontier.d.ts +63 -0
- package/out/tools/coarse-placer/probe-frontier.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/probe-frontier.js +24 -19
- package/out/tools/coarse-placer/probe-frontier.js.map +1 -0
- package/out/tools/coarse-placer/quantize.d.ts +49 -0
- package/out/tools/coarse-placer/quantize.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/quantize.js +10 -11
- package/out/tools/coarse-placer/quantize.js.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/train.d.ts +22 -10
- package/out/tools/coarse-placer/train.d.ts.map +1 -0
- package/out/{coarse-placer/tools → tools/coarse-placer}/train.js +17 -21
- package/out/tools/coarse-placer/train.js.map +1 -0
- package/out/tools/download/libpostal-resources.d.ts +12 -8
- package/out/tools/download/libpostal-resources.d.ts.map +1 -1
- package/out/tools/download/libpostal-resources.js +21 -16
- package/out/tools/download/libpostal-resources.js.map +1 -1
- package/out/tools/download/ssl-address.d.ts +18 -11
- package/out/tools/download/ssl-address.d.ts.map +1 -1
- package/out/tools/download/ssl-address.js +26 -20
- package/out/tools/download/ssl-address.js.map +1 -1
- package/out/tools/generate-language-types.d.ts +15 -15
- package/out/tools/generate-language-types.d.ts.map +1 -1
- package/out/tools/generate-language-types.js +30 -35
- package/out/tools/generate-language-types.js.map +1 -1
- package/out/trust-policies.d.ts +32 -19
- package/out/trust-policies.d.ts.map +1 -1
- package/out/trust-policies.js +37 -22
- package/out/trust-policies.js.map +1 -1
- package/out/types/Classification.d.ts +3 -3
- package/out/types/Classification.d.ts.map +1 -1
- package/out/types/classifier.d.ts +47 -48
- package/out/types/classifier.d.ts.map +1 -1
- package/out/types/classifier.js +5 -10
- package/out/types/classifier.js.map +1 -1
- package/out/types/mapping.d.ts +14 -14
- package/out/types/mapping.d.ts.map +1 -1
- package/out/types/mapping.js +22 -19
- package/out/types/mapping.js.map +1 -1
- package/out/{types/index.d.ts → types.d.ts} +1 -1
- package/out/types.d.ts.map +1 -0
- package/out/{types/index.js → types.js} +1 -1
- package/out/types.js.map +1 -0
- package/out/utils/chunk-process.d.ts +21 -28
- package/out/utils/chunk-process.d.ts.map +1 -1
- package/out/utils/chunk-process.js +16 -23
- package/out/utils/chunk-process.js.map +1 -1
- package/out/utils/collections.d.ts +4 -2
- package/out/utils/collections.d.ts.map +1 -1
- package/out/utils/collections.js +4 -2
- package/out/utils/collections.js.map +1 -1
- package/out/utils/events.d.ts +2 -1
- package/out/utils/events.d.ts.map +1 -1
- package/out/utils/events.js +2 -1
- package/out/utils/events.js.map +1 -1
- package/out/utils/geodatabase-archive.d.ts +23 -25
- package/out/utils/geodatabase-archive.d.ts.map +1 -1
- package/out/utils/geodatabase-archive.js +15 -23
- package/out/utils/geodatabase-archive.js.map +1 -1
- package/out/utils/sleep.d.ts +2 -2
- package/out/utils/sleep.js +2 -2
- package/out/utils/sqlite-rows.d.ts +11 -19
- package/out/utils/sqlite-rows.d.ts.map +1 -1
- package/out/utils/sqlite-rows.js +11 -19
- package/out/utils/sqlite-rows.js.map +1 -1
- package/out/utils/stream-to-disk.d.ts +23 -37
- package/out/utils/stream-to-disk.d.ts.map +1 -1
- package/out/utils/stream-to-disk.js +8 -24
- package/out/utils/stream-to-disk.js.map +1 -1
- package/out/utils/system.d.ts +10 -2
- package/out/utils/system.d.ts.map +1 -1
- package/out/utils/system.js +13 -2
- package/out/utils/system.js.map +1 -1
- package/out/utils/time.d.ts +8 -6
- package/out/utils/time.d.ts.map +1 -1
- package/out/utils/time.js +8 -6
- package/out/utils/time.js.map +1 -1
- package/out/utils/union-find.d.ts +7 -3
- package/out/utils/union-find.d.ts.map +1 -1
- package/out/utils/union-find.js +4 -2
- package/out/utils/union-find.js.map +1 -1
- package/out/{utils/index.js → utils.d.ts} +1 -3
- package/out/utils.d.ts.map +1 -0
- package/out/{utils/index.d.ts → utils.js} +1 -3
- package/out/utils.js.map +1 -0
- package/out/vale.d.ts +10 -14
- package/out/vale.d.ts.map +1 -1
- package/out/vale.js +30 -12
- package/out/vale.js.map +1 -1
- package/out/workspaces.d.ts +16 -9
- package/out/workspaces.d.ts.map +1 -1
- package/out/workspaces.js +47 -12
- package/out/workspaces.js.map +1 -1
- package/package.json +256 -210
- package/{lib/coarse-placer/tools → tools/coarse-placer}/build/dataset.ts +30 -40
- package/{lib/coarse-placer/tools → tools/coarse-placer}/build/outlier/exposure.ts +56 -45
- package/{lib/coarse-placer/tools → tools/coarse-placer}/build/outlier/latin.ts +38 -36
- package/{lib/coarse-placer/tools → tools/coarse-placer}/build/outlier/oa.ts +53 -44
- package/tools/coarse-placer/country-sets.ts +52 -0
- package/{lib/coarse-placer/tools → tools/coarse-placer}/eval/latin-offmap.ts +19 -11
- package/{lib/coarse-placer/tools → tools/coarse-placer}/eval/openset.ts +37 -74
- package/{lib/coarse-placer/tools → tools/coarse-placer}/eval/quant-compare.ts +21 -10
- package/{lib/coarse-placer/tools → tools/coarse-placer}/eval.ts +23 -16
- package/{lib/coarse-placer/tools → tools/coarse-placer}/outlier-rows.ts +21 -21
- package/{lib/coarse-placer/tools → tools/coarse-placer}/paths.ts +21 -16
- package/{lib/coarse-placer/tools → tools/coarse-placer}/probe-frontier.ts +31 -22
- package/{lib/coarse-placer/tools → tools/coarse-placer}/quantize.ts +16 -13
- package/{lib/coarse-placer/tools → tools/coarse-placer}/train.ts +32 -27
- package/{lib/tools → tools}/download/libpostal-resources.ts +23 -17
- package/{lib/tools → tools}/download/ssl-address.ts +34 -24
- package/{lib/tools → tools}/generate-language-types.ts +33 -41
- package/lib/coarse-placer/tools/country-sets.ts +0 -47
- package/lib/coarse-placer/tools/index.ts +0 -24
- package/lib/layers/index.ts +0 -14
- package/lib/strings/case.ts +0 -126
- package/lib/tools/index.ts +0 -12
- package/out/api/index.d.ts.map +0 -1
- package/out/api/index.js.map +0 -1
- package/out/coarse-placer/tools/build/dataset.d.ts +0 -47
- package/out/coarse-placer/tools/build/dataset.d.ts.map +0 -1
- package/out/coarse-placer/tools/build/dataset.js.map +0 -1
- package/out/coarse-placer/tools/build/outlier/exposure.d.ts +0 -46
- package/out/coarse-placer/tools/build/outlier/exposure.d.ts.map +0 -1
- package/out/coarse-placer/tools/build/outlier/exposure.js.map +0 -1
- package/out/coarse-placer/tools/build/outlier/latin.d.ts +0 -55
- package/out/coarse-placer/tools/build/outlier/latin.d.ts.map +0 -1
- package/out/coarse-placer/tools/build/outlier/latin.js.map +0 -1
- package/out/coarse-placer/tools/build/outlier/oa.d.ts +0 -63
- package/out/coarse-placer/tools/build/outlier/oa.d.ts.map +0 -1
- package/out/coarse-placer/tools/build/outlier/oa.js.map +0 -1
- package/out/coarse-placer/tools/country-sets.d.ts +0 -28
- package/out/coarse-placer/tools/country-sets.d.ts.map +0 -1
- package/out/coarse-placer/tools/country-sets.js +0 -45
- package/out/coarse-placer/tools/country-sets.js.map +0 -1
- package/out/coarse-placer/tools/eval/latin-offmap.d.ts +0 -44
- package/out/coarse-placer/tools/eval/latin-offmap.d.ts.map +0 -1
- package/out/coarse-placer/tools/eval/latin-offmap.js.map +0 -1
- package/out/coarse-placer/tools/eval/openset.d.ts +0 -72
- package/out/coarse-placer/tools/eval/openset.d.ts.map +0 -1
- package/out/coarse-placer/tools/eval/openset.js.map +0 -1
- package/out/coarse-placer/tools/eval/quant-compare.d.ts.map +0 -1
- package/out/coarse-placer/tools/eval/quant-compare.js.map +0 -1
- package/out/coarse-placer/tools/eval.d.ts.map +0 -1
- package/out/coarse-placer/tools/eval.js.map +0 -1
- package/out/coarse-placer/tools/index.d.ts +0 -24
- package/out/coarse-placer/tools/index.d.ts.map +0 -1
- package/out/coarse-placer/tools/index.js +0 -24
- package/out/coarse-placer/tools/index.js.map +0 -1
- package/out/coarse-placer/tools/outlier-rows.d.ts.map +0 -1
- package/out/coarse-placer/tools/outlier-rows.js.map +0 -1
- package/out/coarse-placer/tools/paths.d.ts.map +0 -1
- package/out/coarse-placer/tools/paths.js.map +0 -1
- package/out/coarse-placer/tools/probe-frontier.d.ts +0 -54
- package/out/coarse-placer/tools/probe-frontier.d.ts.map +0 -1
- package/out/coarse-placer/tools/probe-frontier.js.map +0 -1
- package/out/coarse-placer/tools/quantize.d.ts +0 -46
- package/out/coarse-placer/tools/quantize.d.ts.map +0 -1
- package/out/coarse-placer/tools/quantize.js.map +0 -1
- package/out/coarse-placer/tools/train.d.ts.map +0 -1
- package/out/coarse-placer/tools/train.js.map +0 -1
- package/out/decoder/index.d.ts.map +0 -1
- package/out/decoder/index.js.map +0 -1
- package/out/env/index.d.ts.map +0 -1
- package/out/env/index.js.map +0 -1
- package/out/layers/index.d.ts +0 -14
- package/out/layers/index.d.ts.map +0 -1
- package/out/layers/index.js +0 -14
- package/out/layers/index.js.map +0 -1
- package/out/license/index.d.ts.map +0 -1
- package/out/license/index.js.map +0 -1
- package/out/license/key/index.d.ts +0 -96
- package/out/license/key/index.d.ts.map +0 -1
- package/out/license/key/index.js.map +0 -1
- package/out/locale/index.d.ts.map +0 -1
- package/out/locale/index.js.map +0 -1
- package/out/locale/profiles/index.d.ts.map +0 -1
- package/out/locale/profiles/index.js.map +0 -1
- package/out/logging/index.d.ts.map +0 -1
- package/out/logging/index.js.map +0 -1
- package/out/pipeline/index.d.ts.map +0 -1
- package/out/pipeline/index.js.map +0 -1
- package/out/policy/index.d.ts.map +0 -1
- package/out/policy/index.js.map +0 -1
- package/out/resolver/index.d.ts.map +0 -1
- package/out/resolver/index.js +0 -18
- package/out/resolver/index.js.map +0 -1
- package/out/resources/index.d.ts.map +0 -1
- package/out/resources/index.js.map +0 -1
- package/out/resources/languages/index.d.ts.map +0 -1
- package/out/resources/languages/index.js.map +0 -1
- package/out/resources/whosonfirst/index.d.ts.map +0 -1
- package/out/resources/whosonfirst/index.js.map +0 -1
- package/out/resources/whosonfirst/placetypes/index.d.ts.map +0 -1
- package/out/resources/whosonfirst/placetypes/index.js.map +0 -1
- package/out/routing/index.d.ts.map +0 -1
- package/out/routing/index.js.map +0 -1
- package/out/scripting/index.d.ts.map +0 -1
- package/out/scripting/index.js.map +0 -1
- package/out/scripting/utils/index.d.ts.map +0 -1
- package/out/scripting/utils/index.js.map +0 -1
- package/out/strings/case.d.ts +0 -48
- package/out/strings/case.d.ts.map +0 -1
- package/out/strings/case.js +0 -105
- package/out/strings/case.js.map +0 -1
- package/out/tokenization/index.d.ts.map +0 -1
- package/out/tokenization/index.js.map +0 -1
- package/out/tools/index.d.ts +0 -12
- package/out/tools/index.d.ts.map +0 -1
- package/out/tools/index.js +0 -12
- package/out/tools/index.js.map +0 -1
- package/out/types/index.d.ts.map +0 -1
- package/out/types/index.js.map +0 -1
- package/out/utils/index.d.ts.map +0 -1
- package/out/utils/index.js.map +0 -1
- package/vitest.config.ts +0 -54
- /package/lib/{decoder/index.ts → decoder.ts} +0 -0
- /package/lib/locale/{profiles/index.ts → profiles.ts} +0 -0
- /package/lib/{logging/index.ts → logging.ts} +0 -0
- /package/lib/{policy/index.ts → policy.ts} +0 -0
- /package/lib/resources/{languages/index.ts → languages.ts} +0 -0
- /package/lib/resources/whosonfirst/{placetypes/index.ts → placetypes.ts} +0 -0
- /package/lib/{tokenization/index.ts → tokenization.ts} +0 -0
- /package/lib/{types/index.ts → types.ts} +0 -0
|
@@ -3,27 +3,25 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* OpenAddresses Latin-off-map outlier exposure for the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* learned an "off-map" boundary (night-15 finding). OpenAddresses covers far more countries —
|
|
10
|
-
* this assembles address strings from OA's per-country CSVs and appends them as `country:
|
|
11
|
-
* "OTHER"`.
|
|
6
|
+
* OpenAddresses Latin-off-map outlier exposure for the coarse-placer. OpenAddresses covers far
|
|
7
|
+
* more countries than the Overture addresses theme, so this assembles address strings from OA's
|
|
8
|
+
* per-country CSVs and appends them as `country: "other"`.
|
|
12
9
|
*
|
|
13
|
-
* Discipline
|
|
10
|
+
* Discipline:
|
|
14
11
|
*
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* - hold out whole language families (Nordic, Baltic, …) so a trained sibling's shared n-grams
|
|
13
|
+
* cannot rescue the generalization metric. Train families feed train/val/test(indist).
|
|
14
|
+
* Heldout families go only to the dedicated test file.
|
|
18
15
|
* - Schema variance: read via DuckDB read_csv_auto(..., union_by_name) so differing per-source OA
|
|
19
|
-
* schemas align
|
|
16
|
+
* schemas align. Assemble to the same format the in-map rows use (build-outlier-latin's
|
|
20
17
|
* assemble).
|
|
21
|
-
* - Dedup (per country)
|
|
22
|
-
*
|
|
23
|
-
* - Country filter: only
|
|
18
|
+
* - Dedup (per country) plus per-country CAP (downsample): PL/CZ dwarf others, so cap so `other`
|
|
19
|
+
* keeps a mixed country profile.
|
|
20
|
+
* - Country filter: only off-map countries (never the 11 in-map). The in-map test.jsonl is
|
|
21
|
+
* untouched.
|
|
24
22
|
*
|
|
25
|
-
* Run
|
|
26
|
-
* dedicated test file and appends fresh
|
|
23
|
+
* Run after build-dataset + the exposure outliers (it appends). Re-runnable: it rewrites the
|
|
24
|
+
* dedicated test file and appends fresh `other` rows. Rebuild train/val before re-running.
|
|
27
25
|
*
|
|
28
26
|
* Run: `mailwoman placer build-dataset --outliers oa --oa-dir <extracted-OA-root> [--per-country
|
|
29
27
|
* 6000]`
|
|
@@ -32,12 +30,12 @@
|
|
|
32
30
|
import { type PathBuilderLike, resolvePath } from "path-ts"
|
|
33
31
|
|
|
34
32
|
import { hashFNV1a } from "#coarse-placer/fnv-hash"
|
|
35
|
-
import {
|
|
36
|
-
import { assembleOutlierRow, collectOutlierRows, otherRowsJSONL } from "#coarse-placer/tools/outlier-rows"
|
|
37
|
-
import { defaultDataDir } from "#coarse-placer/tools/paths"
|
|
33
|
+
import { dataRootPath } from "#data-root"
|
|
38
34
|
import { errorMessage } from "#errors/schema"
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
35
|
+
import { appendLocalTextFile, writeLocalJSONLFile } from "#fs/writers"
|
|
36
|
+
import { COUNTRIES } from "#tools/coarse-placer/country-sets"
|
|
37
|
+
import { assembleOutlierRow, collectOutlierRows, otherRowsJSONL } from "#tools/coarse-placer/outlier-rows"
|
|
38
|
+
import { defaultDataDir } from "#tools/coarse-placer/paths"
|
|
41
39
|
|
|
42
40
|
interface OaTestRow {
|
|
43
41
|
raw: string
|
|
@@ -52,15 +50,21 @@ interface OaTestRow {
|
|
|
52
50
|
*/
|
|
53
51
|
export interface BuildOutlierOAOptions {
|
|
54
52
|
/**
|
|
55
|
-
* Extracted OpenAddresses root.
|
|
53
|
+
* Extracted OpenAddresses root.
|
|
54
|
+
*
|
|
55
|
+
* Default `$MAILWOMAN_DATA_ROOT/openaddresses/extracted`.
|
|
56
56
|
*/
|
|
57
57
|
oaDir?: PathBuilderLike
|
|
58
58
|
/**
|
|
59
|
-
* Row cap per off-map country.
|
|
59
|
+
* Row cap per off-map country.
|
|
60
|
+
*
|
|
61
|
+
* Default 6000.
|
|
60
62
|
*/
|
|
61
63
|
perCountry?: number
|
|
62
64
|
/**
|
|
63
|
-
* Dataset dir the
|
|
65
|
+
* Dataset dir the `other` rows append to.
|
|
66
|
+
*
|
|
67
|
+
* Default `<repo>/data/coarse-placer`.
|
|
64
68
|
*/
|
|
65
69
|
data?: PathBuilderLike
|
|
66
70
|
}
|
|
@@ -77,16 +81,17 @@ export interface BuildOutlierOAResult {
|
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
/**
|
|
80
|
-
* The in-map countries the coarse-placer routes to
|
|
84
|
+
* The in-map countries the coarse-placer routes to, never appear in `other`.
|
|
81
85
|
*/
|
|
82
86
|
const IN_MAP = new Set<string>(COUNTRIES)
|
|
83
87
|
|
|
84
88
|
/**
|
|
85
|
-
* Language/region families for the leave-one-family-out split.
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
89
|
+
* Language/region families for the leave-one-family-out split.
|
|
90
|
+
*
|
|
91
|
+
* Off-map countries that may appear in OA's europe+asia zips.
|
|
92
|
+
* The actual train/heldout set is intersected with what's on disk at runtime.
|
|
93
|
+
*
|
|
94
|
+
* Heldout families are the generalization probe, so the model never sees a row from them.
|
|
90
95
|
*/
|
|
91
96
|
const FAMILIES: Record<string, string[]> = {
|
|
92
97
|
slavic_latin: ["PL", "CZ", "SK", "SI"],
|
|
@@ -102,8 +107,11 @@ const FAMILIES: Record<string, string[]> = {
|
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
/**
|
|
105
|
-
* Leave-one-language-
|
|
106
|
-
*
|
|
110
|
+
* Leave-one-language-family-out probe: hold out whole families the model never sees a row from.
|
|
111
|
+
*
|
|
112
|
+
* Baltic is distinct and uses Latin script.
|
|
113
|
+
* Oceania is distinct and uses English Latin script.
|
|
114
|
+
* The Middle East examples use romanized non-Latin scripts.
|
|
107
115
|
*/
|
|
108
116
|
const HELDOUT_FAMILIES = new Set(["baltic", "oceania", "middle_east"])
|
|
109
117
|
|
|
@@ -113,7 +121,8 @@ const HELDOUT_FAMILIES = new Set(["baltic", "oceania", "middle_east"])
|
|
|
113
121
|
const oaLocality = (r: Record<string, unknown>): string => (r.city ?? "").toString().trim()
|
|
114
122
|
|
|
115
123
|
/**
|
|
116
|
-
* Coarse-placer OpenAddresses Latin-off-map outlier builder
|
|
124
|
+
* Coarse-placer OpenAddresses Latin-off-map outlier builder.
|
|
125
|
+
* See the module doc.
|
|
117
126
|
*/
|
|
118
127
|
export async function buildOutlierOA(
|
|
119
128
|
options: BuildOutlierOAOptions = {},
|
|
@@ -132,19 +141,21 @@ export async function buildOutlierOA(
|
|
|
132
141
|
*/
|
|
133
142
|
async function rowsFor(cc: string): Promise<string[]> {
|
|
134
143
|
const lc = cc.toLowerCase()
|
|
135
|
-
// OA collected layout: `<cc>/[<region>/]<source>.csv`
|
|
136
|
-
// rooting the glob at <cc>).
|
|
144
|
+
// OA collected layout: `<cc>/[<region>/]<source>.csv`
|
|
145
|
+
// (country at root; `summary/` excluded by rooting the glob at <cc>).
|
|
146
|
+
// `**` matches zero-or-more dirs → handles both flat + region-nested.
|
|
137
147
|
const glob = resolvePath(oaDir, lc, "**", "*.csv")
|
|
138
148
|
let res
|
|
139
149
|
|
|
140
150
|
try {
|
|
141
151
|
res = await duck.runAndReadAll(
|
|
142
|
-
// union_by_name aligns the differing per-source schemas
|
|
143
|
-
//
|
|
152
|
+
// union_by_name aligns the differing per-source schemas.
|
|
153
|
+
// Lower the header access so number / number both resolve.
|
|
154
|
+
// Pull a generous superset, dedup+cap in JS.
|
|
144
155
|
`SELECT COLUMNS('(?i)^(number|street|city|postcode)$') FROM read_csv_auto('${glob}', union_by_name=true, ignore_errors=true, sample_size=-1) LIMIT ${PER * 8}`
|
|
145
156
|
)
|
|
146
157
|
} catch (error) {
|
|
147
|
-
// oxlint-disable-next-line mailwoman/prefer-spliterator -- An in-memory error message
|
|
158
|
+
// oxlint-disable-next-line mailwoman/prefer-spliterator -- An in-memory error message rather than a file.
|
|
148
159
|
report?.(` ${cc}: SKIP (${errorMessage(error).split("\n")[0]})`)
|
|
149
160
|
|
|
150
161
|
return []
|
|
@@ -152,7 +163,8 @@ export async function buildOutlierOA(
|
|
|
152
163
|
|
|
153
164
|
const out = collectOutlierRows(
|
|
154
165
|
res.getRowObjects().map((r) => {
|
|
155
|
-
//
|
|
166
|
+
// columns() preserves source-case keys.
|
|
167
|
+
// Normalize to lowercase access.
|
|
156
168
|
const row: Record<string, unknown> = {}
|
|
157
169
|
|
|
158
170
|
for (const [k, v] of Object.entries(r)) {
|
|
@@ -169,7 +181,7 @@ export async function buildOutlierOA(
|
|
|
169
181
|
|
|
170
182
|
const trainAppend: string[] = []
|
|
171
183
|
const valAppend: string[] = []
|
|
172
|
-
const testRows: OaTestRow[] = [] // {raw, country:"
|
|
184
|
+
const testRows: OaTestRow[] = [] // {raw, country:"other", group, srcCountry, family}
|
|
173
185
|
let trainCC = 0
|
|
174
186
|
let heldCC = 0
|
|
175
187
|
|
|
@@ -216,10 +228,7 @@ export async function buildOutlierOA(
|
|
|
216
228
|
await appendLocalTextFile(otherRowsJSONL(trainAppend), resolvePath(dataDir, "train.jsonl"))
|
|
217
229
|
await appendLocalTextFile(otherRowsJSONL(valAppend), resolvePath(dataDir, "val.jsonl"))
|
|
218
230
|
|
|
219
|
-
await
|
|
220
|
-
testRows.map((r) => JSON.stringify(r)).join("\n") + "\n",
|
|
221
|
-
resolvePath(dataDir, "test-latin-offmap-oa.jsonl")
|
|
222
|
-
)
|
|
231
|
+
await writeLocalJSONLFile(testRows, resolvePath(dataDir, "test-latin-offmap-oa.jsonl"))
|
|
223
232
|
|
|
224
233
|
report?.(`\nTRAIN countries: ${trainCC} · HELDOUT countries: ${heldCC}`)
|
|
225
234
|
report?.(`appended OTHER → train +${trainAppend.length}, val +${valAppend.length}`)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The country sets the coarse-placer dataset is drawn from. `build-dataset.ts` samples them. the
|
|
7
|
+
* outlier builders consult them to keep in-map countries out of the `other` pool.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The in-map countries the coarse-placer routes to, drawn from the v0.5.0 corpus `train` extracts.
|
|
12
|
+
*/
|
|
13
|
+
export const COUNTRIES = ["US", "FR", "GB", "CN", "NL", "IT", "DE", "JP", "ES", "KR", "TW"] as const
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The EU expansion.
|
|
17
|
+
*
|
|
18
|
+
* The v0.5.0 corpus contains zero rows for these locales, so they are drawn from the
|
|
19
|
+
* Overture per-country addresses theme (the same source build-eu-eval-set.ts uses).
|
|
20
|
+
*
|
|
21
|
+
* These become first-class in-map countries so the soft country prior can pin them.
|
|
22
|
+
*/
|
|
23
|
+
export const NEW_EU = [
|
|
24
|
+
"AT",
|
|
25
|
+
"BE",
|
|
26
|
+
"CH",
|
|
27
|
+
"CZ",
|
|
28
|
+
"DK",
|
|
29
|
+
"EE",
|
|
30
|
+
"FI",
|
|
31
|
+
"HR",
|
|
32
|
+
"LT",
|
|
33
|
+
"LU",
|
|
34
|
+
"LV",
|
|
35
|
+
"NO",
|
|
36
|
+
"PL",
|
|
37
|
+
"PT",
|
|
38
|
+
"SI",
|
|
39
|
+
"SK",
|
|
40
|
+
] as const
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The in-map dilution fix.
|
|
44
|
+
*
|
|
45
|
+
* DE/ES/IT/NL are already in countries (corpus format), but the eu-eval sets
|
|
46
|
+
* and every NEW_EU country are Overture format.
|
|
47
|
+
*
|
|
48
|
+
* Supplement their corpus rows with an Overture sample so each owns its own format shape.
|
|
49
|
+
* The format then stops being discriminative and the model falls back to the linguistic n-grams.
|
|
50
|
+
* GB is excluded because its Overture parquet is empty.
|
|
51
|
+
*/
|
|
52
|
+
export const IN_MAP_EU = ["DE", "ES", "IT", "NL"] as const
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Measure the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* retrain through this to read the before/after.
|
|
6
|
+
* Measure the coarse-placer's handling of the Latin-script off-map residual. A Latin off-map
|
|
7
|
+
* address is handled when the model routes it to `other` or abstains. Anything else is a
|
|
8
|
+
* confident mis-placement onto a wrong trained country. Reports handled-rate overall, by group
|
|
9
|
+
* (indist is held-out rows of trained-other countries, heldout is countries never trained), and
|
|
10
|
+
* by source country, plus where the misses land.
|
|
12
11
|
*
|
|
13
12
|
* Run: `mailwoman placer eval latin-offmap --model <dir> [--abstain 0.5]`
|
|
14
13
|
*/
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
import { basename, type PathBuilderLike, resolvePath, resolvePathBuilder } from "path-ts"
|
|
17
16
|
|
|
18
17
|
import { CoarsePlacer, isOffMapHandled } from "#coarse-placer/coarse-placer"
|
|
19
|
-
import { defaultDataDir, defaultModelDir, readLatinOffmapRows } from "#coarse-placer/
|
|
18
|
+
import { defaultDataDir, defaultModelDir, readLatinOffmapRows } from "#tools/coarse-placer/paths"
|
|
20
19
|
import { formatPercent } from "#utils"
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -36,15 +35,21 @@ interface OffMapRow {
|
|
|
36
35
|
*/
|
|
37
36
|
export interface EvalLatinOffmapOptions {
|
|
38
37
|
/**
|
|
39
|
-
* Model artifact dir.
|
|
38
|
+
* Model artifact dir.
|
|
39
|
+
*
|
|
40
|
+
* Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`.
|
|
40
41
|
*/
|
|
41
42
|
model?: PathBuilderLike
|
|
42
43
|
/**
|
|
43
|
-
* Abstention threshold.
|
|
44
|
+
* Abstention threshold.
|
|
45
|
+
*
|
|
46
|
+
* Default 0.5.
|
|
44
47
|
*/
|
|
45
48
|
abstain?: number
|
|
46
49
|
/**
|
|
47
|
-
* Dataset dir holding the Latin off-map test sets.
|
|
50
|
+
* Dataset dir holding the Latin off-map test sets.
|
|
51
|
+
*
|
|
52
|
+
* Default `<repo>/data/coarse-placer`.
|
|
48
53
|
*/
|
|
49
54
|
data?: PathBuilderLike
|
|
50
55
|
}
|
|
@@ -58,7 +63,10 @@ export interface EvalLatinOffmapResult {
|
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
/**
|
|
61
|
-
* Coarse-placer Latin off-map handling eval
|
|
66
|
+
* Coarse-placer Latin off-map handling eval.
|
|
67
|
+
* See the module doc.
|
|
68
|
+
*
|
|
69
|
+
* Emits the report to stdout.
|
|
62
70
|
*/
|
|
63
71
|
export async function evalLatinOffmap(options: EvalLatinOffmapOptions = {}): Promise<EvalLatinOffmapResult> {
|
|
64
72
|
const modelDir = resolvePathBuilder(options.model || defaultModelDir())
|
|
@@ -3,35 +3,12 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* the leave-one-family-out probe (in-map accuracy vs off-map HELDOUT-family caught). This asks:
|
|
9
|
-
* does a DIFFERENT open-set score, read off the same frozen weights, clear the 90/90 the softmax
|
|
10
|
-
* can't?
|
|
11
|
-
*
|
|
12
|
-
* The 11-way routing (argmax over the in-map classes) is FIXED — the model is unchanged. The only
|
|
13
|
-
* thing each score changes is the REJECT decision (keep the in-map route vs. abstain → OTHER). We
|
|
14
|
-
* sweep each score's threshold and trace its (in-map accuracy, heldout-caught) Pareto.
|
|
15
|
-
*
|
|
16
|
-
* Scores compared (all functions of the frozen 12 logits / 11 in-map logits `z`):
|
|
17
|
-
*
|
|
18
|
-
* - Maxprob : softmax max over the 11 in-map classes (the verdict's baseline detector)
|
|
19
|
-
* - P_inmap : 1 - P(OTHER) (trust the model's own OTHER head)
|
|
20
|
-
* - Energy : logsumexp(z) (free-energy; higher = more in-map)
|
|
21
|
-
* - Maxlogit : max(z)
|
|
22
|
-
* - Maha : -min_c (z-μ_c)ᵀ Σ⁻¹ (z-μ_c), class-conditional Gaussians (tied Σ) fit on in-map TRAIN
|
|
23
|
-
* logits (Lee et al. 2018, in the 11-dim in-map-logit space — the linear model's only dense
|
|
24
|
-
* representation). Higher = closer to the in-map manifold.
|
|
25
|
-
*
|
|
26
|
-
* In-map accuracy = of the 11-country test rows, fraction NOT rejected AND argmax-in-map == truth.
|
|
27
|
-
* heldout caught = of the never-trained off-map families (baltic/oceania/middle-east), fraction
|
|
28
|
-
* rejected. Both move with the threshold; the Pareto is the whole story.
|
|
29
|
-
*
|
|
30
|
-
* Run: `mailwoman placer eval openset [--model <dir>] [--out-md <path>]`
|
|
6
|
+
* This command compares post-hoc rejection scores on a frozen coarse-placer model. It keeps routing fixed.
|
|
7
|
+
* Thresholds are selected on one half of the data and reported on the other half.
|
|
31
8
|
*/
|
|
32
9
|
|
|
33
10
|
/* oxlint-disable sister-software/prefer-region-over-marks -- these markers label steps inside one
|
|
34
|
-
procedure
|
|
11
|
+
procedure rather than sections of declarations. A region there folds no code a reader wants folded. */
|
|
35
12
|
|
|
36
13
|
import { basename, type PathBuilderLike, resolvePath, resolvePathBuilder } from "path-ts"
|
|
37
14
|
import { JSONSpliterator } from "spliterator"
|
|
@@ -39,18 +16,11 @@ import { JSONSpliterator } from "spliterator"
|
|
|
39
16
|
import { type CoarsePlacerMeta, readWeightsBin } from "#coarse-placer/coarse-placer"
|
|
40
17
|
import { COARSE_CLASSES, featurize } from "#coarse-placer/featurize"
|
|
41
18
|
import { logsumexp, softmaxInto } from "#coarse-placer/math"
|
|
42
|
-
import { defaultDataDir, defaultModelDir, readLatinOffmapRows } from "#coarse-placer/tools/paths"
|
|
43
19
|
import { readLocalJSONFile } from "#fs/readers"
|
|
44
20
|
import { writeLocalFile } from "#fs/writers"
|
|
21
|
+
import { defaultDataDir, defaultModelDir, readLatinOffmapRows } from "#tools/coarse-placer/paths"
|
|
45
22
|
|
|
46
|
-
/**
|
|
47
|
-
* Steps in the threshold sweep; finer than the reporting precision so the knee is not missed.
|
|
48
|
-
*/
|
|
49
23
|
const QUANTILE_SWEEP_STEPS = 200
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Percentage both held-out catch and in-map accuracy must clear for an operating point to qualify.
|
|
53
|
-
*/
|
|
54
24
|
const TARGET_PERCENT = 90
|
|
55
25
|
|
|
56
26
|
type ScoreKey = "maxprob" | "p_inmap" | "energy" | "maxlogit" | "maha"
|
|
@@ -79,29 +49,26 @@ interface ParetoPoint {
|
|
|
79
49
|
*/
|
|
80
50
|
export interface EvalOpenSetOptions {
|
|
81
51
|
/**
|
|
82
|
-
*
|
|
52
|
+
* The model artifact directory, default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`.
|
|
83
53
|
*/
|
|
84
54
|
model?: PathBuilderLike
|
|
85
55
|
/**
|
|
86
|
-
*
|
|
56
|
+
* The dataset directory, default `<repo>/data/coarse-placer`.
|
|
87
57
|
*/
|
|
88
58
|
data?: PathBuilderLike
|
|
89
59
|
/**
|
|
90
|
-
*
|
|
60
|
+
* The number of rows per class used to fit the Mahalanobis score.
|
|
91
61
|
*/
|
|
92
62
|
fitPerClass?: number
|
|
93
|
-
/**
|
|
94
|
-
* Also write the markdown report here.
|
|
95
|
-
*/
|
|
96
63
|
outMd?: string
|
|
97
64
|
}
|
|
98
65
|
|
|
99
66
|
/**
|
|
100
|
-
*
|
|
67
|
+
* The result of {@linkcode evalOpenSet}.
|
|
101
68
|
*/
|
|
102
69
|
export interface EvalOpenSetResult {
|
|
103
70
|
/**
|
|
104
|
-
*
|
|
71
|
+
* The score with the highest test-half minimum of in-map accuracy and held-out catch rate.
|
|
105
72
|
*/
|
|
106
73
|
winner: ScoreKey
|
|
107
74
|
honestMin: number
|
|
@@ -110,7 +77,7 @@ export interface EvalOpenSetResult {
|
|
|
110
77
|
}
|
|
111
78
|
|
|
112
79
|
/**
|
|
113
|
-
*
|
|
80
|
+
* Inverts a matrix with Gauss-Jordan elimination and partial pivoting.
|
|
114
81
|
*/
|
|
115
82
|
function inverse(M: Float64Array[]): number[][] {
|
|
116
83
|
const n = M.length
|
|
@@ -156,7 +123,7 @@ function inverse(M: Float64Array[]): number[][] {
|
|
|
156
123
|
}
|
|
157
124
|
|
|
158
125
|
/**
|
|
159
|
-
*
|
|
126
|
+
* Compares open-set rejection scores and returns a Markdown report.
|
|
160
127
|
*/
|
|
161
128
|
export async function evalOpenSet(
|
|
162
129
|
options: EvalOpenSetOptions = {},
|
|
@@ -173,13 +140,13 @@ export async function evalOpenSet(
|
|
|
173
140
|
const C = meta.classes.length
|
|
174
141
|
const D = meta.featureDim
|
|
175
142
|
const OTHER = meta.classes.indexOf("OTHER")
|
|
176
|
-
const IN = meta.classes.map((_, i) => i).filter((i) => i !== OTHER)
|
|
143
|
+
const IN = meta.classes.map((_, i) => i).filter((i) => i !== OTHER)
|
|
177
144
|
const nIn = IN.length
|
|
178
145
|
|
|
179
146
|
if (W.length !== C * D) throw new Error(`weights ${W.length} ≠ ${C}×${D}`)
|
|
180
147
|
|
|
181
148
|
/**
|
|
182
|
-
*
|
|
149
|
+
* Returns the logits of every class before temperature scaling.
|
|
183
150
|
*/
|
|
184
151
|
function logits(raw: string): Float64Array {
|
|
185
152
|
const feats = featurize(raw)
|
|
@@ -200,7 +167,7 @@ export async function evalOpenSet(
|
|
|
200
167
|
}
|
|
201
168
|
|
|
202
169
|
/**
|
|
203
|
-
*
|
|
170
|
+
* Returns the in-map logits in class order.
|
|
204
171
|
*/
|
|
205
172
|
const inVec = (z: Float64Array): number[] => IN.map((c) => z[c]!)
|
|
206
173
|
|
|
@@ -208,8 +175,7 @@ export async function evalOpenSet(
|
|
|
208
175
|
return JSONSpliterator.fromAsync<DataRow>(resolvePath(dataDir, file))
|
|
209
176
|
}
|
|
210
177
|
|
|
211
|
-
//
|
|
212
|
-
// mean in the nIn-dim in-map-logit space + a tied (shared) covariance.
|
|
178
|
+
// The Mahalanobis score uses class means and a shared covariance fitted on in-map training logits.
|
|
213
179
|
report?.("fitting Mahalanobis on in-map train logits…")
|
|
214
180
|
const trainRows = load("train.jsonl")
|
|
215
181
|
const byClass = new Map<string, string[]>(COARSE_CLASSES.map((c): [string, string[]] => [c, []]))
|
|
@@ -223,10 +189,9 @@ export async function evalOpenSet(
|
|
|
223
189
|
}
|
|
224
190
|
}
|
|
225
191
|
|
|
226
|
-
const means = new Map<string, Float64Array>()
|
|
192
|
+
const means = new Map<string, Float64Array>()
|
|
227
193
|
const counts = new Map<string, number>()
|
|
228
194
|
|
|
229
|
-
// Accumulate per-class means.
|
|
230
195
|
for (const [country, raws] of byClass) {
|
|
231
196
|
if (!raws.length) continue
|
|
232
197
|
const mu = new Float64Array(nIn)
|
|
@@ -247,7 +212,7 @@ export async function evalOpenSet(
|
|
|
247
212
|
counts.set(country, raws.length)
|
|
248
213
|
}
|
|
249
214
|
|
|
250
|
-
//
|
|
215
|
+
// The shared covariance is computed from class-centered logits.
|
|
251
216
|
const Sigma = Array.from({ length: nIn }, () => new Float64Array(nIn))
|
|
252
217
|
let nTot = 0
|
|
253
218
|
|
|
@@ -280,7 +245,7 @@ export async function evalOpenSet(
|
|
|
280
245
|
}
|
|
281
246
|
}
|
|
282
247
|
|
|
283
|
-
//
|
|
248
|
+
// A small diagonal term keeps the covariance invertible.
|
|
284
249
|
for (let a = 0; a < nIn; a++) {
|
|
285
250
|
Sigma[a]![a] = Sigma[a]![a]! + 1e-3
|
|
286
251
|
}
|
|
@@ -288,7 +253,7 @@ export async function evalOpenSet(
|
|
|
288
253
|
const SigmaInv = inverse(Sigma)
|
|
289
254
|
|
|
290
255
|
/**
|
|
291
|
-
*
|
|
256
|
+
* Returns the negated squared Mahalanobis distance to the nearest class mean.
|
|
292
257
|
*/
|
|
293
258
|
function mahaScore(z: Float64Array): number {
|
|
294
259
|
const v = inVec(z)
|
|
@@ -321,13 +286,11 @@ export async function evalOpenSet(
|
|
|
321
286
|
return -best
|
|
322
287
|
}
|
|
323
288
|
|
|
324
|
-
// MARK: Score both splits
|
|
325
|
-
|
|
326
289
|
report?.("scoring in-map test + off-map heldout…")
|
|
327
290
|
const SCORES: ScoreKey[] = ["maxprob", "p_inmap", "energy", "maxlogit", "maha"]
|
|
328
291
|
|
|
329
292
|
/**
|
|
330
|
-
*
|
|
293
|
+
* Computes every score for one address and checks its in-map route against the label.
|
|
331
294
|
*/
|
|
332
295
|
function scoreRow(raw: string, trueCountry: string | undefined): ScoredRow {
|
|
333
296
|
const z = logits(raw)
|
|
@@ -336,7 +299,7 @@ export async function evalOpenSet(
|
|
|
336
299
|
softmaxInto(z, probs)
|
|
337
300
|
const zin = inVec(z)
|
|
338
301
|
|
|
339
|
-
//
|
|
302
|
+
// Every score uses the route selected by the highest in-map logit.
|
|
340
303
|
let amIdx = 0,
|
|
341
304
|
am = -Infinity
|
|
342
305
|
|
|
@@ -361,7 +324,6 @@ export async function evalOpenSet(
|
|
|
361
324
|
}
|
|
362
325
|
}
|
|
363
326
|
|
|
364
|
-
// the 11 countries only
|
|
365
327
|
const inmapScored = await load("test.jsonl")
|
|
366
328
|
.filter((r) => r.country !== "OTHER")
|
|
367
329
|
.map((r) => scoreRow(r.raw, r.country))
|
|
@@ -371,16 +333,17 @@ export async function evalOpenSet(
|
|
|
371
333
|
|
|
372
334
|
const heldoutScored = heldout.map((r) => scoreRow(r.raw, undefined))
|
|
373
335
|
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
// TEST — so the number is a generalization estimate, not a threshold fit to the set it's scored on.
|
|
336
|
+
// Even-indexed rows form the development half.
|
|
337
|
+
// Odd-indexed rows form the test half.
|
|
377
338
|
const inDev = inmapScored.filter((_, i) => i % 2 === 0)
|
|
378
339
|
const inTest = inmapScored.filter((_, i) => i % 2 === 1)
|
|
379
340
|
const heldDev = heldoutScored.filter((_, i) => i % 2 === 0)
|
|
380
341
|
const heldTest = heldoutScored.filter((_, i) => i % 2 === 1)
|
|
381
342
|
|
|
382
343
|
/**
|
|
383
|
-
*
|
|
344
|
+
* Measures in-map accuracy and held-out catch rate at threshold `t`.
|
|
345
|
+
*
|
|
346
|
+
* A row is kept when its score is at or above `t` and rejected otherwise.
|
|
384
347
|
*/
|
|
385
348
|
function pointAt(scoreKey: ScoreKey, t: number, inSplit: ScoredRow[], heldSplit: ScoredRow[]): ParetoPoint {
|
|
386
349
|
let keepCorrect = 0
|
|
@@ -400,10 +363,11 @@ export async function evalOpenSet(
|
|
|
400
363
|
return { t, inMapAcc: (100 * keepCorrect) / inSplit.length, heldCaught: (100 * caught) / heldSplit.length }
|
|
401
364
|
}
|
|
402
365
|
|
|
403
|
-
|
|
404
|
-
|
|
366
|
+
/**
|
|
367
|
+
* Sweeps thresholds for one score and returns its trade-off points.
|
|
368
|
+
*/
|
|
405
369
|
function paretoFor(scoreKey: ScoreKey) {
|
|
406
|
-
// Candidate thresholds
|
|
370
|
+
// Candidate thresholds are quantiles of the pooled in-map and held-out scores.
|
|
407
371
|
const all = [...inmapScored, ...heldoutScored].map((o) => o.s[scoreKey]).toSorted((a, b) => a - b)
|
|
408
372
|
const ts: number[] = []
|
|
409
373
|
|
|
@@ -414,12 +378,13 @@ export async function evalOpenSet(
|
|
|
414
378
|
const uniq = [...new Set(ts)]
|
|
415
379
|
const pts: ParetoPoint[] = uniq.map((t) => pointAt(scoreKey, t, inmapScored, heldoutScored))
|
|
416
380
|
|
|
417
|
-
//
|
|
418
|
-
let balanced: { val: number; pt: ParetoPoint | null } = { val: -1, pt: null }
|
|
419
|
-
|
|
381
|
+
// The balanced point maximizes the smaller of the two rates.
|
|
382
|
+
let balanced: { val: number; pt: ParetoPoint | null } = { val: -1, pt: null }
|
|
383
|
+
// This point has the best in-map accuracy among points that meet the held-out target.
|
|
384
|
+
let atHeld90: ParetoPoint | null = null
|
|
385
|
+
// This point has the best held-out catch rate among points that meet the in-map target.
|
|
420
386
|
let atIn90: ParetoPoint | null = null
|
|
421
387
|
|
|
422
|
-
// highest heldCaught with inMapAcc >= 90
|
|
423
388
|
for (const p of pts) {
|
|
424
389
|
const m = Math.min(p.inMapAcc, p.heldCaught)
|
|
425
390
|
|
|
@@ -436,7 +401,7 @@ export async function evalOpenSet(
|
|
|
436
401
|
}
|
|
437
402
|
}
|
|
438
403
|
|
|
439
|
-
//
|
|
404
|
+
// The balanced threshold is chosen on the development half and measured on the test half.
|
|
440
405
|
let devBest: { val: number; t: number | null } = { val: -1, t: null }
|
|
441
406
|
|
|
442
407
|
for (const p of pts) {
|
|
@@ -456,8 +421,6 @@ export async function evalOpenSet(
|
|
|
456
421
|
type Pareto = ReturnType<typeof paretoFor>
|
|
457
422
|
const results = Object.fromEntries(SCORES.map((k) => [k, paretoFor(k)])) as Record<ScoreKey, Pareto>
|
|
458
423
|
|
|
459
|
-
// MARK: Report.
|
|
460
|
-
|
|
461
424
|
const f = (x: number | null | undefined): string => (x == null ? "—" : x.toFixed(1))
|
|
462
425
|
|
|
463
426
|
const lines: string[] = [
|
|
@@ -508,7 +471,7 @@ export async function evalOpenSet(
|
|
|
508
471
|
|
|
509
472
|
lines.push("")
|
|
510
473
|
|
|
511
|
-
//
|
|
474
|
+
// Scores are ranked by their test-half minimum.
|
|
512
475
|
const ranked = SCORES.map((k) => ({
|
|
513
476
|
k,
|
|
514
477
|
honestMin: Math.min(results[k].honest.inMapAcc, results[k].honest.heldCaught),
|