@mailwoman/core 9.4.0 → 10.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/lib/coarse-placer/tools/{build-dataset.ts → build/dataset.ts} +2 -1
- package/lib/coarse-placer/tools/{build-outlier-latin.ts → build/outlier/latin.ts} +4 -3
- package/lib/coarse-placer/tools/{eval-openset.ts → eval/openset.ts} +11 -7
- package/lib/coarse-placer/tools/{eval-quant-compare.ts → eval/quant-compare.ts} +2 -1
- package/lib/coarse-placer/tools/eval.ts +2 -2
- package/lib/coarse-placer/tools/index.ts +7 -7
- package/lib/coarse-placer/tools/train.ts +4 -6
- package/lib/decoder/build-tree.ts +2 -1
- package/lib/decoder/containment.ts +2 -1
- package/lib/decoder/index.ts +5 -5
- package/lib/decoder/parse-diff.ts +1 -1
- package/lib/decoder/proposals-to-tree.ts +3 -1
- package/lib/decoder/{serialize-json.ts → serialize/json.ts} +3 -2
- package/lib/decoder/{serialize-tuples.ts → serialize/tuples.ts} +2 -1
- package/lib/decoder/{tree-shape.ts → tree/shape.ts} +4 -3
- package/lib/decoder/types.ts +1 -3
- package/lib/decoder/unknown-spans.ts +1 -1
- package/lib/decoder/validate-tree.ts +2 -1
- package/lib/fs/readers/stat.ts +244 -0
- package/lib/fs/readers.ts +27 -271
- package/lib/fs/streams.ts +58 -0
- package/lib/fs/writers.ts +5 -5
- package/lib/fs/zip.ts +64 -8
- package/lib/license/configured.ts +2 -2
- package/lib/license/index.ts +2 -2
- package/lib/license/obligations.ts +1 -1
- package/lib/license/stamp.ts +1 -1
- package/lib/locale/locale.ts +2 -1
- package/lib/locale/registry.ts +2 -1
- package/lib/overture-pins.ts +24 -0
- package/lib/pipeline/preferences.ts +13 -0
- package/lib/pipeline/result.ts +84 -0
- package/lib/pipeline/runtime-pipeline.ts +9 -15
- package/lib/pipeline/types.ts +3 -73
- package/lib/policy/defaults.ts +2 -1
- package/lib/policy/policy.ts +3 -1
- package/lib/policy/registry.ts +3 -1
- package/lib/process.ts +3 -1
- package/lib/resolver/authoritative-provider.ts +1 -1
- package/lib/resolver/index.ts +1 -9
- package/lib/resolver/synthetic-id-ranges.ts +83 -0
- package/lib/resolver/types.ts +2 -10
- package/lib/resources/whosonfirst/placetypes/Placetype.ts +7 -6
- package/lib/scripting/arguments.ts +34 -0
- package/lib/scripting/utils/index.ts +1 -1
- package/lib/strings/case.ts +13 -2
- package/lib/tokenization/Graph.ts +3 -4
- package/lib/tools/{download-libpostal-resources.ts → download/libpostal-resources.ts} +3 -2
- package/lib/tools/generate-language-types.ts +3 -4
- package/lib/tools/index.ts +2 -2
- package/lib/types/classifier.ts +2 -1
- package/lib/types/index.ts +0 -1
- package/lib/types/mapping.ts +2 -1
- package/lib/workspaces.ts +9 -2
- package/out/api/APIClient.d.ts.map +1 -1
- package/out/api/arcgis.d.ts.map +1 -1
- package/out/api/defaults.d.ts.map +1 -1
- package/out/api/headless.d.ts.map +1 -1
- package/out/api/ogc.d.ts.map +1 -1
- package/out/api/paced-client.js.map +1 -1
- package/out/api/pacer.d.ts.map +1 -1
- package/out/api/pacer.js.map +1 -1
- package/out/api/responses.d.ts.map +1 -1
- package/out/api/{test-clocks.d.ts → test/clocks.d.ts} +1 -1
- package/out/api/test/clocks.d.ts.map +1 -0
- package/out/api/{test-clocks.js → test/clocks.js} +1 -1
- package/out/api/test/clocks.js.map +1 -0
- package/out/api/{test-transport.d.ts → test/transport.d.ts} +1 -1
- package/out/api/test/transport.d.ts.map +1 -0
- package/out/api/{test-transport.js → test/transport.js} +1 -1
- package/out/api/test/transport.js.map +1 -0
- package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
- package/out/coarse-placer/coarse-placer.js.map +1 -1
- package/out/coarse-placer/featurize.d.ts.map +1 -1
- package/out/coarse-placer/tools/{build-dataset.d.ts → build/dataset.d.ts} +1 -1
- package/out/coarse-placer/tools/build/dataset.d.ts.map +1 -0
- package/out/coarse-placer/tools/{build-dataset.js → build/dataset.js} +3 -2
- package/out/coarse-placer/tools/build/dataset.js.map +1 -0
- package/out/coarse-placer/tools/{build-outlier-exposure.d.ts → build/outlier/exposure.d.ts} +1 -1
- package/out/coarse-placer/tools/build/outlier/exposure.d.ts.map +1 -0
- package/out/coarse-placer/tools/{build-outlier-exposure.js → build/outlier/exposure.js} +1 -1
- package/out/coarse-placer/tools/build/outlier/exposure.js.map +1 -0
- package/out/coarse-placer/tools/{build-outlier-latin.d.ts → build/outlier/latin.d.ts} +3 -3
- package/out/coarse-placer/tools/build/outlier/latin.d.ts.map +1 -0
- package/out/coarse-placer/tools/{build-outlier-latin.js → build/outlier/latin.js} +4 -3
- package/out/coarse-placer/tools/build/outlier/latin.js.map +1 -0
- package/out/coarse-placer/tools/{build-outlier-oa.d.ts → build/outlier/oa.d.ts} +1 -1
- package/out/coarse-placer/tools/build/outlier/oa.d.ts.map +1 -0
- package/out/coarse-placer/tools/{build-outlier-oa.js → build/outlier/oa.js} +1 -1
- package/out/coarse-placer/tools/build/outlier/oa.js.map +1 -0
- package/out/coarse-placer/tools/country-sets.d.ts.map +1 -1
- package/out/coarse-placer/tools/{eval-latin-offmap.d.ts → eval/latin-offmap.d.ts} +1 -1
- package/out/coarse-placer/tools/eval/latin-offmap.d.ts.map +1 -0
- package/out/coarse-placer/tools/{eval-latin-offmap.js → eval/latin-offmap.js} +1 -1
- package/out/coarse-placer/tools/eval/latin-offmap.js.map +1 -0
- package/out/coarse-placer/tools/{eval-openset.d.ts → eval/openset.d.ts} +1 -1
- package/out/coarse-placer/tools/eval/openset.d.ts.map +1 -0
- package/out/coarse-placer/tools/{eval-openset.js → eval/openset.js} +10 -7
- package/out/coarse-placer/tools/eval/openset.js.map +1 -0
- package/out/coarse-placer/tools/{eval-quant-compare.d.ts → eval/quant-compare.d.ts} +1 -1
- package/out/coarse-placer/tools/eval/quant-compare.d.ts.map +1 -0
- package/out/coarse-placer/tools/{eval-quant-compare.js → eval/quant-compare.js} +2 -2
- package/out/coarse-placer/tools/eval/quant-compare.js.map +1 -0
- package/out/coarse-placer/tools/eval.js +2 -2
- package/out/coarse-placer/tools/eval.js.map +1 -1
- package/out/coarse-placer/tools/index.d.ts +7 -7
- package/out/coarse-placer/tools/index.js +7 -7
- package/out/coarse-placer/tools/probe-frontier.js.map +1 -1
- package/out/coarse-placer/tools/quantize.js.map +1 -1
- package/out/coarse-placer/tools/train.d.ts.map +1 -1
- package/out/coarse-placer/tools/train.js +2 -3
- package/out/coarse-placer/tools/train.js.map +1 -1
- package/out/data-root.js.map +1 -1
- package/out/decoder/build-tree.d.ts.map +1 -1
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/containment.d.ts +2 -2
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/index.d.ts +5 -5
- package/out/decoder/index.js +5 -5
- package/out/decoder/parse-diff.js +1 -1
- package/out/decoder/parse-diff.js.map +1 -1
- package/out/decoder/proposals-to-tree.d.ts +2 -1
- package/out/decoder/proposals-to-tree.d.ts.map +1 -1
- package/out/decoder/proposals-to-tree.js.map +1 -1
- package/out/decoder/{serialize-json.d.ts → serialize/json.d.ts} +2 -2
- package/out/decoder/serialize/json.d.ts.map +1 -0
- package/out/decoder/{serialize-json.js → serialize/json.js} +2 -2
- package/out/decoder/serialize/json.js.map +1 -0
- package/out/decoder/{serialize-tuples.d.ts → serialize/tuples.d.ts} +2 -2
- package/out/decoder/serialize/tuples.d.ts.map +1 -0
- package/out/decoder/{serialize-tuples.js → serialize/tuples.js} +1 -1
- package/out/decoder/serialize/tuples.js.map +1 -0
- package/out/decoder/{serialize-xml.d.ts → serialize/xml.d.ts} +1 -1
- package/out/decoder/serialize/xml.d.ts.map +1 -0
- package/out/decoder/{serialize-xml.js → serialize/xml.js} +1 -1
- package/out/decoder/serialize/xml.js.map +1 -0
- package/out/decoder/{tree-shape.d.ts → tree/shape.d.ts} +2 -2
- package/out/decoder/tree/shape.d.ts.map +1 -0
- package/out/decoder/{tree-shape.js → tree/shape.js} +3 -3
- package/out/decoder/tree/shape.js.map +1 -0
- package/out/decoder/{tree-walk.d.ts → tree/walk.d.ts} +1 -1
- package/out/decoder/tree/walk.d.ts.map +1 -0
- package/out/decoder/{tree-walk.js → tree/walk.js} +1 -1
- package/out/decoder/tree/walk.js.map +1 -0
- package/out/decoder/types.d.ts +1 -2
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +1 -1
- package/out/decoder/types.js.map +1 -1
- package/out/decoder/unknown-spans.js +1 -1
- package/out/decoder/validate-tree.d.ts +1 -1
- package/out/decoder/validate-tree.d.ts.map +1 -1
- package/out/decoder/validate-tree.js.map +1 -1
- package/out/env/index.d.ts +1 -1
- package/out/env/schema.d.ts +4 -4
- package/out/errors/schema.d.ts.map +1 -1
- package/out/errors/schema.js.map +1 -1
- package/out/fs/formatters.d.ts.map +1 -1
- package/out/fs/formatters.js.map +1 -1
- package/out/fs/readers/stat.d.ts +126 -0
- package/out/fs/readers/stat.d.ts.map +1 -0
- package/out/fs/readers/stat.js +202 -0
- package/out/fs/readers/stat.js.map +1 -0
- package/out/fs/readers.d.ts +11 -150
- package/out/fs/readers.d.ts.map +1 -1
- package/out/fs/readers.js +22 -225
- package/out/fs/readers.js.map +1 -1
- package/out/fs/streams.d.ts +33 -0
- package/out/fs/streams.d.ts.map +1 -1
- package/out/fs/streams.js +49 -0
- package/out/fs/streams.js.map +1 -1
- package/out/fs/writers.d.ts +5 -5
- package/out/fs/writers.js +5 -5
- package/out/fs/zip.d.ts +21 -2
- package/out/fs/zip.d.ts.map +1 -1
- package/out/fs/zip.js +36 -8
- package/out/fs/zip.js.map +1 -1
- package/out/git.js.map +1 -1
- package/out/html/document.js.map +1 -1
- package/out/json.d.ts.map +1 -1
- package/out/layers/coverage.js.map +1 -1
- package/out/layers/schema.d.ts.map +1 -1
- package/out/license/configured.d.ts +1 -1
- 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/docs-site.js.map +1 -1
- package/out/license/index.d.ts +2 -2
- package/out/license/index.d.ts.map +1 -1
- package/out/license/index.js +2 -2
- package/out/license/index.js.map +1 -1
- package/out/license/{key-file.d.ts → key/file.d.ts} +1 -1
- package/out/license/key/file.d.ts.map +1 -0
- package/out/license/{key-file.js → key/file.js} +1 -1
- package/out/license/key/file.js.map +1 -0
- package/out/license/{key.d.ts → key/index.d.ts} +1 -1
- package/out/license/key/index.d.ts.map +1 -0
- package/out/license/{key.js → key/index.js} +1 -1
- package/out/license/key/index.js.map +1 -0
- package/out/license/obligations.d.ts +1 -1
- package/out/license/obligations.d.ts.map +1 -1
- package/out/license/publication.js.map +1 -1
- package/out/license/register.d.ts.map +1 -1
- package/out/license/stamp.d.ts +1 -1
- package/out/license/stamp.d.ts.map +1 -1
- package/out/license/status.js.map +1 -1
- package/out/locale/locale.d.ts +1 -1
- package/out/locale/locale.d.ts.map +1 -1
- package/out/locale/registry.d.ts.map +1 -1
- package/out/locale/registry.js +1 -1
- package/out/locale/registry.js.map +1 -1
- package/out/locale/zh-cn-units.d.ts.map +1 -1
- package/out/logging/shared.d.ts.map +1 -1
- package/out/module/resolvers.js.map +1 -1
- package/out/objects.js.map +1 -1
- package/out/overture-pins.d.ts +24 -0
- package/out/overture-pins.d.ts.map +1 -0
- package/out/overture-pins.js +24 -0
- package/out/overture-pins.js.map +1 -0
- package/out/paths.js.map +1 -1
- package/out/pipeline/preferences.d.ts +13 -0
- package/out/pipeline/preferences.d.ts.map +1 -0
- package/out/pipeline/preferences.js +7 -0
- package/out/pipeline/preferences.js.map +1 -0
- package/out/pipeline/result.d.ts +72 -0
- package/out/pipeline/result.d.ts.map +1 -0
- package/out/pipeline/result.js +7 -0
- package/out/pipeline/result.js.map +1 -0
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +7 -13
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-proposer.js.map +1 -1
- package/out/pipeline/types.d.ts +3 -71
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +2 -0
- package/out/pipeline/types.js.map +1 -1
- package/out/policy/defaults.d.ts +1 -1
- package/out/policy/defaults.d.ts.map +1 -1
- package/out/policy/defaults.js +1 -1
- package/out/policy/defaults.js.map +1 -1
- package/out/policy/policy.d.ts +2 -1
- package/out/policy/policy.d.ts.map +1 -1
- package/out/policy/proposal-collection.js.map +1 -1
- package/out/policy/registry.d.ts +2 -1
- package/out/policy/registry.d.ts.map +1 -1
- package/out/policy/registry.js.map +1 -1
- package/out/process.d.ts +2 -2
- package/out/process.d.ts.map +1 -1
- package/out/process.js.map +1 -1
- package/out/random.d.ts.map +1 -1
- package/out/release-config.js.map +1 -1
- package/out/resolver/authoritative-provider.d.ts +1 -1
- package/out/resolver/authoritative-provider.d.ts.map +1 -1
- package/out/resolver/fixture-authoritative-provider.js.map +1 -1
- package/out/resolver/index.d.ts +2 -2
- package/out/resolver/index.d.ts.map +1 -1
- package/out/resolver/index.js +1 -1
- package/out/resolver/index.js.map +1 -1
- package/out/resolver/synthetic-id-ranges.d.ts +66 -0
- package/out/resolver/synthetic-id-ranges.d.ts.map +1 -0
- package/out/resolver/synthetic-id-ranges.js +73 -0
- package/out/resolver/synthetic-id-ranges.js.map +1 -0
- package/out/resolver/types.d.ts +1 -2
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +0 -1
- package/out/resolver/types.js.map +1 -1
- package/out/resources/languages/index.js.map +1 -1
- package/out/resources/languages/types.gen.d.ts.map +1 -1
- package/out/resources/locale.d.ts.map +1 -1
- package/out/resources/set.d.ts.map +1 -1
- package/out/resources/set.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/placetypes/Placetype.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.js +7 -6
- package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/definition.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
- package/out/routing/index.d.ts.map +1 -1
- package/out/routing/index.js.map +1 -1
- package/out/scripting/arguments.d.ts +7 -0
- package/out/scripting/arguments.d.ts.map +1 -1
- package/out/scripting/arguments.js +29 -0
- package/out/scripting/arguments.js.map +1 -1
- package/out/scripting/command.d.ts.map +1 -1
- package/out/scripting/ingest-chunk-script.d.ts.map +1 -1
- package/out/scripting/utils/index.d.ts +1 -1
- package/out/scripting/utils/index.d.ts.map +1 -1
- package/out/scripting/utils/index.js +1 -1
- package/out/scripting/utils/index.js.map +1 -1
- package/out/strings/case.d.ts +3 -0
- package/out/strings/case.d.ts.map +1 -1
- package/out/strings/case.js +12 -2
- package/out/strings/case.js.map +1 -1
- 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 +0 -4
- package/out/tokenization/Graph.js.map +1 -1
- package/out/tokenization/Span.d.ts.map +1 -1
- package/out/tokenization/Span.js.map +1 -1
- package/out/tokenization/normalizer.d.ts.map +1 -1
- package/out/tokenization/normalizer.js.map +1 -1
- package/out/tools/{download-libpostal-resources.d.ts → download/libpostal-resources.d.ts} +1 -1
- package/out/tools/download/libpostal-resources.d.ts.map +1 -0
- package/out/tools/{download-libpostal-resources.js → download/libpostal-resources.js} +4 -3
- package/out/tools/download/libpostal-resources.js.map +1 -0
- package/out/tools/{download-ssl-address.d.ts → download/ssl-address.d.ts} +1 -1
- package/out/tools/download/ssl-address.d.ts.map +1 -0
- package/out/tools/{download-ssl-address.js → download/ssl-address.js} +1 -1
- package/out/tools/download/ssl-address.js.map +1 -0
- package/out/tools/generate-language-types.d.ts.map +1 -1
- package/out/tools/generate-language-types.js +3 -4
- package/out/tools/generate-language-types.js.map +1 -1
- package/out/tools/index.d.ts +2 -2
- package/out/tools/index.js +2 -2
- package/out/types/Classification.d.ts +2 -2
- package/out/types/Classification.d.ts.map +1 -1
- package/out/types/classifier.d.ts +1 -1
- package/out/types/classifier.d.ts.map +1 -1
- package/out/types/index.d.ts +0 -1
- package/out/types/index.d.ts.map +1 -1
- package/out/types/index.js +0 -1
- package/out/types/index.js.map +1 -1
- package/out/types/mapping.d.ts +1 -1
- package/out/types/mapping.d.ts.map +1 -1
- package/out/types/mapping.js.map +1 -1
- package/out/utils/time.js.map +1 -1
- package/out/workspaces.d.ts.map +1 -1
- package/out/workspaces.js +7 -2
- package/out/workspaces.js.map +1 -1
- package/package.json +63 -53
- package/lib/resolver/placetype-map.ts +0 -157
- package/lib/types/component.ts +0 -96
- package/out/api/test-clocks.d.ts.map +0 -1
- package/out/api/test-clocks.js.map +0 -1
- package/out/api/test-transport.d.ts.map +0 -1
- package/out/api/test-transport.js.map +0 -1
- 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.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.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.map +0 -1
- package/out/coarse-placer/tools/build-outlier-oa.js.map +0 -1
- 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.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/decoder/serialize-json.d.ts.map +0 -1
- package/out/decoder/serialize-json.js.map +0 -1
- package/out/decoder/serialize-tuples.d.ts.map +0 -1
- package/out/decoder/serialize-tuples.js.map +0 -1
- package/out/decoder/serialize-xml.d.ts.map +0 -1
- package/out/decoder/serialize-xml.js.map +0 -1
- package/out/decoder/tree-shape.d.ts.map +0 -1
- package/out/decoder/tree-shape.js.map +0 -1
- package/out/decoder/tree-walk.d.ts.map +0 -1
- package/out/decoder/tree-walk.js.map +0 -1
- package/out/license/key-file.d.ts.map +0 -1
- package/out/license/key-file.js.map +0 -1
- package/out/license/key.d.ts.map +0 -1
- package/out/license/key.js.map +0 -1
- package/out/resolver/placetype-map.d.ts +0 -83
- package/out/resolver/placetype-map.d.ts.map +0 -1
- package/out/resolver/placetype-map.js +0 -130
- package/out/resolver/placetype-map.js.map +0 -1
- package/out/tools/download-libpostal-resources.d.ts.map +0 -1
- package/out/tools/download-libpostal-resources.js.map +0 -1
- package/out/tools/download-ssl-address.d.ts.map +0 -1
- package/out/tools/download-ssl-address.js.map +0 -1
- package/out/types/component.d.ts +0 -50
- package/out/types/component.d.ts.map +0 -1
- package/out/types/component.js +0 -84
- package/out/types/component.js.map +0 -1
- /package/lib/api/{test-clocks.ts → test/clocks.ts} +0 -0
- /package/lib/api/{test-transport.ts → test/transport.ts} +0 -0
- /package/lib/coarse-placer/tools/{build-outlier-exposure.ts → build/outlier/exposure.ts} +0 -0
- /package/lib/coarse-placer/tools/{build-outlier-oa.ts → build/outlier/oa.ts} +0 -0
- /package/lib/coarse-placer/tools/{eval-latin-offmap.ts → eval/latin-offmap.ts} +0 -0
- /package/lib/decoder/{serialize-xml.ts → serialize/xml.ts} +0 -0
- /package/lib/decoder/{tree-walk.ts → tree/walk.ts} +0 -0
- /package/lib/license/{key-file.ts → key/file.ts} +0 -0
- /package/lib/license/{key.ts → key/index.ts} +0 -0
- /package/lib/tools/{download-ssl-address.ts → download/ssl-address.ts} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The pinned Overture release for the ADDRESSES theme.
|
|
6
|
+
*
|
|
7
|
+
* Overture publishes one release tag across its themes and prunes old releases from the bucket on roughly a monthly
|
|
8
|
+
* window, so every reader carries a pin. The pins are per THEME, not per tool: the divisions theme (the admin
|
|
9
|
+
* gazetteer) and the places theme (poi.db) are pinned together in `mailwoman`'s gazetteer pipeline (`defaults.ts`,
|
|
10
|
+
* `poi/defaults.ts`), and bumping them is a new-vintage decision for those artifacts. This is the third pin, for the
|
|
11
|
+
* addresses theme every address-point, postcode-centroid, district and coarse-placer build reads, and it lives in
|
|
12
|
+
* core because readers exist on both sides of the `mailwoman` boundary.
|
|
13
|
+
*
|
|
14
|
+
* Five tools carried their own literal before this constant existed, at two different releases, and one of them
|
|
15
|
+
* would have defaulted to a directory that holds no addresses parquet at all: on the lab data root the addresses
|
|
16
|
+
* theme is fetched at `2026-06-17.0` (53 country parquets), the older `2026-05-20.0` holds 23, and the divisions
|
|
17
|
+
* pin's directory holds none. A tool that needs another vintage takes it through its own `--release` option; the
|
|
18
|
+
* default is this one, so the vintage a build read is the vintage the corpus and the CJK board were built from.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The addresses-theme release directory under `<data-root>/overture/`.
|
|
23
|
+
*/
|
|
24
|
+
export const OVERTURE_ADDRESSES_RELEASE = "2026-06-17.0"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @file Runtime pipeline host preferences.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Independent host/browser preferences. A timezone is evidence, never a locale conversion.
|
|
9
|
+
*/
|
|
10
|
+
export interface MachinePreferences {
|
|
11
|
+
locale?: Intl.UnicodeBCP47LocaleIdentifier
|
|
12
|
+
timeZone?: string
|
|
13
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @file Runtime pipeline result contract.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { AddressTree } from "#decoder/types"
|
|
8
|
+
import type {
|
|
9
|
+
LocaleHint,
|
|
10
|
+
NormalizedInputLite,
|
|
11
|
+
PhraseProposal,
|
|
12
|
+
PipelineTiming,
|
|
13
|
+
PipelineFaultStage,
|
|
14
|
+
QueryIntentMarker,
|
|
15
|
+
QueryKindResult,
|
|
16
|
+
QueryShapeLite,
|
|
17
|
+
POIIntentOutcome,
|
|
18
|
+
} from "#pipeline/types"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* One stage crash the coordinator caught and degraded past.
|
|
22
|
+
*
|
|
23
|
+
* A fault is NOT an error return: `runPipeline` still resolves, and `tree` still carries whatever the remaining stages
|
|
24
|
+
* could prove. What the fault buys the caller is the ability to tell "the model faulted and the rule-based stages
|
|
25
|
+
* filled the tree back in" apart from "the model ran and found nothing" — which, before #40, was impossible from the
|
|
26
|
+
* outside. See the `safeClassify` docstring for the measured failure this was written against.
|
|
27
|
+
*/
|
|
28
|
+
export interface PipelineFault {
|
|
29
|
+
stage: PipelineFaultStage
|
|
30
|
+
/**
|
|
31
|
+
* The thrown value's `name` (`TypeError`, `RangeError`, …), or `"Error"` when something that isn't an `Error` was
|
|
32
|
+
* thrown. Machine-stable enough to branch on; the `cause` carries the rest.
|
|
33
|
+
*/
|
|
34
|
+
name: string
|
|
35
|
+
message: string
|
|
36
|
+
/**
|
|
37
|
+
* The value the stage threw, verbatim — kept so a caller can rethrow it or read its stack. Not JSON-serializable in
|
|
38
|
+
* the useful sense; serialize `stage`/`name`/`message` when you need this on a wire.
|
|
39
|
+
*/
|
|
40
|
+
cause: unknown
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Result of one `runPipeline` call.
|
|
45
|
+
*/
|
|
46
|
+
export interface PipelineResult {
|
|
47
|
+
input: string
|
|
48
|
+
normalized: NormalizedInputLite
|
|
49
|
+
queryShape: QueryShapeLite
|
|
50
|
+
locale: LocaleHint
|
|
51
|
+
kind: QueryKindResult
|
|
52
|
+
/**
|
|
53
|
+
* Stage 2.7 phrase proposals when a grouper was wired. Empty array when the coordinator ran with no grouper
|
|
54
|
+
* (pre-v0.5.0 callers) or when the fast-path skipped Stage 2.7. Stage 3 consumes this as conditioning; Stage 5
|
|
55
|
+
* consumes it as boundary candidates.
|
|
56
|
+
*/
|
|
57
|
+
phraseProposals: PhraseProposal[]
|
|
58
|
+
tree: AddressTree
|
|
59
|
+
/**
|
|
60
|
+
* Present only when the poi-intent stage produced an outcome (path === "poi").
|
|
61
|
+
*/
|
|
62
|
+
poiIntent?: POIIntentOutcome
|
|
63
|
+
timing: PipelineTiming
|
|
64
|
+
/**
|
|
65
|
+
* Every stage crash the coordinator caught and degraded past, in the order they happened. **Always present** — an
|
|
66
|
+
* empty array is the coordinator stating that no stage faulted, which is a different claim from a missing field.
|
|
67
|
+
* Non-empty means the tree you are holding was produced with at least one stage down; see {@link PipelineFault}.
|
|
68
|
+
*/
|
|
69
|
+
faults: PipelineFault[]
|
|
70
|
+
/**
|
|
71
|
+
* Query-intent advisories (ROAD_TO_V9 §4), lifted from the kind classifier's verdict. **Always present** — an empty
|
|
72
|
+
* array is the coordinator stating that the intent vocabulary examined this query and had nothing to say, which is a
|
|
73
|
+
* different claim from a missing field (the {@link faults} discipline, same reasoning).
|
|
74
|
+
*
|
|
75
|
+
* Nothing here changed which answer won. The markers are advisory by construction: the two intent kinds that could
|
|
76
|
+
* have displaced a structural incumbent are scored below it, and the two that do win the top slot (`near_me`,
|
|
77
|
+
* `poi_category`) route exactly as their incumbents did.
|
|
78
|
+
*/
|
|
79
|
+
intentMarkers: QueryIntentMarker[]
|
|
80
|
+
/**
|
|
81
|
+
* Which path the coordinator took. `"fast-path"` skipped stages 3-5; `"poi"` took the intent branch.
|
|
82
|
+
*/
|
|
83
|
+
path: "fast-path" | "full" | "poi"
|
|
84
|
+
}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* Implementation contract per `docs/engineering/reference/STAGES.md`.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import type { ComponentTag } from "@mailwoman/codex/component"
|
|
16
|
+
|
|
17
|
+
import { isBareTreeOf } from "#decoder/tree/shape"
|
|
16
18
|
import type { AddressNode, AddressTree } from "#decoder/types"
|
|
17
19
|
import { errorMessage } from "#errors/schema"
|
|
18
20
|
import { PipelineFaultStage, WORD_CONSISTENCY_SHIP_DEFAULT, deriveInputMode } from "#pipeline/types"
|
|
@@ -32,7 +34,6 @@ import type {
|
|
|
32
34
|
QueryShapeLite,
|
|
33
35
|
RuntimePipelineStages,
|
|
34
36
|
} from "#pipeline/types"
|
|
35
|
-
import type { ComponentTag } from "#types/component"
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Kind confidence required to skip the full pipeline. Set high deliberately: a short-circuit that fires on a wrong kind
|
|
@@ -48,21 +49,14 @@ const SHORT_CIRCUIT_MIN_CONFIDENCE = 0.95
|
|
|
48
49
|
const SHORT_CIRCUIT_MAX_LOCALITY_LENGTH = 30
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
52
|
+
* Whether a QueryShape known-format name names a postcode shape. `@mailwoman/query-shape` owns the format table and its
|
|
53
|
+
* naming convention — `us_zip`, `us_zip4`, or `<cc>_postcode` — and its test pins every table entry to that convention;
|
|
54
|
+
* this package cannot depend on query-shape, so it reads the convention rather than a copied list. The copied list it
|
|
55
|
+
* replaces held seven of the table's twelve names, so a Dutch, Czech, Slovak, Swedish or Greek postcode passed the
|
|
56
|
+
* query-shape and kind-classifier checks and missed this pipeline's own.
|
|
53
57
|
*/
|
|
54
|
-
const POSTCODE_FORMATS: ReadonlySet<string> = new Set([
|
|
55
|
-
"us_zip",
|
|
56
|
-
"us_zip4",
|
|
57
|
-
"uk_postcode",
|
|
58
|
-
"fr_postcode",
|
|
59
|
-
"de_postcode",
|
|
60
|
-
"ca_postcode",
|
|
61
|
-
"jp_postcode",
|
|
62
|
-
])
|
|
63
|
-
|
|
64
58
|
function isPostcodeFormat(format: string): boolean {
|
|
65
|
-
return
|
|
59
|
+
return format === "us_zip" || format === "us_zip4" || format.endsWith("_postcode")
|
|
66
60
|
}
|
|
67
61
|
|
|
68
62
|
/**
|
package/lib/pipeline/types.ts
CHANGED
|
@@ -14,16 +14,12 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import type { AddressTree } from "#decoder/types"
|
|
17
|
+
import type { MachinePreferences } from "#pipeline/preferences"
|
|
17
18
|
import type { ResolveOpts, Resolver, ResolverBackend } from "#resolver/types"
|
|
18
19
|
import type { Section } from "#types/classifier"
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
export interface MachinePreferences {
|
|
24
|
-
locale?: Intl.UnicodeBCP47LocaleIdentifier
|
|
25
|
-
timeZone?: string
|
|
26
|
-
}
|
|
21
|
+
export { type PipelineFault, type PipelineResult } from "#pipeline/result"
|
|
22
|
+
export { type MachinePreferences } from "#pipeline/preferences"
|
|
27
23
|
|
|
28
24
|
/**
|
|
29
25
|
* Optional user-location signal for Stage 6 resolver scoring.
|
|
@@ -612,69 +608,3 @@ export const PipelineFaultStage = {
|
|
|
612
608
|
} as const
|
|
613
609
|
|
|
614
610
|
export type PipelineFaultStage = (typeof PipelineFaultStage)[keyof typeof PipelineFaultStage]
|
|
615
|
-
|
|
616
|
-
/**
|
|
617
|
-
* One stage crash the coordinator caught and degraded past.
|
|
618
|
-
*
|
|
619
|
-
* A fault is NOT an error return: `runPipeline` still resolves, and `tree` still carries whatever the remaining stages
|
|
620
|
-
* could prove. What the fault buys the caller is the ability to tell "the model faulted and the rule-based stages
|
|
621
|
-
* filled the tree back in" apart from "the model ran and found nothing" — which, before #40, was impossible from the
|
|
622
|
-
* outside. See the `safeClassify` docstring for the measured failure this was written against.
|
|
623
|
-
*/
|
|
624
|
-
export interface PipelineFault {
|
|
625
|
-
stage: PipelineFaultStage
|
|
626
|
-
/**
|
|
627
|
-
* The thrown value's `name` (`TypeError`, `RangeError`, …), or `"Error"` when something that isn't an `Error` was
|
|
628
|
-
* thrown. Machine-stable enough to branch on; the `cause` carries the rest.
|
|
629
|
-
*/
|
|
630
|
-
name: string
|
|
631
|
-
message: string
|
|
632
|
-
/**
|
|
633
|
-
* The value the stage threw, verbatim — kept so a caller can rethrow it or read its stack. Not JSON-serializable in
|
|
634
|
-
* the useful sense; serialize `stage`/`name`/`message` when you need this on a wire.
|
|
635
|
-
*/
|
|
636
|
-
cause: unknown
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Result of one `runPipeline` call.
|
|
641
|
-
*/
|
|
642
|
-
export interface PipelineResult {
|
|
643
|
-
input: string
|
|
644
|
-
normalized: NormalizedInputLite
|
|
645
|
-
queryShape: QueryShapeLite
|
|
646
|
-
locale: LocaleHint
|
|
647
|
-
kind: QueryKindResult
|
|
648
|
-
/**
|
|
649
|
-
* Stage 2.7 phrase proposals when a grouper was wired. Empty array when the coordinator ran with no grouper
|
|
650
|
-
* (pre-v0.5.0 callers) or when the fast-path skipped Stage 2.7. Stage 3 consumes this as conditioning; Stage 5
|
|
651
|
-
* consumes it as boundary candidates.
|
|
652
|
-
*/
|
|
653
|
-
phraseProposals: PhraseProposal[]
|
|
654
|
-
tree: AddressTree
|
|
655
|
-
/**
|
|
656
|
-
* Present only when the poi-intent stage produced an outcome (path === "poi").
|
|
657
|
-
*/
|
|
658
|
-
poiIntent?: POIIntentOutcome
|
|
659
|
-
timing: PipelineTiming
|
|
660
|
-
/**
|
|
661
|
-
* Every stage crash the coordinator caught and degraded past, in the order they happened. **Always present** — an
|
|
662
|
-
* empty array is the coordinator stating that no stage faulted, which is a different claim from a missing field.
|
|
663
|
-
* Non-empty means the tree you are holding was produced with at least one stage down; see {@link PipelineFault}.
|
|
664
|
-
*/
|
|
665
|
-
faults: PipelineFault[]
|
|
666
|
-
/**
|
|
667
|
-
* Query-intent advisories (ROAD_TO_V9 §4), lifted from the kind classifier's verdict. **Always present** — an empty
|
|
668
|
-
* array is the coordinator stating that the intent vocabulary examined this query and had nothing to say, which is a
|
|
669
|
-
* different claim from a missing field (the {@link faults} discipline, same reasoning).
|
|
670
|
-
*
|
|
671
|
-
* Nothing here changed which answer won. The markers are advisory by construction: the two intent kinds that could
|
|
672
|
-
* have displaced a structural incumbent are scored below it, and the two that do win the top slot (`near_me`,
|
|
673
|
-
* `poi_category`) route exactly as their incumbents did.
|
|
674
|
-
*/
|
|
675
|
-
intentMarkers: QueryIntentMarker[]
|
|
676
|
-
/**
|
|
677
|
-
* Which path the coordinator took. `"fast-path"` skipped stages 3-5; `"poi"` took the intent branch.
|
|
678
|
-
*/
|
|
679
|
-
path: "fast-path" | "full" | "poi"
|
|
680
|
-
}
|
package/lib/policy/defaults.ts
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* edits one entry here with a commit-message rationale.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { COMPONENT_TAGS, type ComponentTag } from "@mailwoman/codex/component"
|
|
12
|
+
|
|
11
13
|
import type { ClassifierPolicy, PolicyMode } from "#policy/policy"
|
|
12
|
-
import { COMPONENT_TAGS, type ComponentTag } from "#types"
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Build a fresh array of policies — one per `ComponentTag`, all in `mode`. Returns a new array on each call; callers
|
package/lib/policy/policy.ts
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* neural-backed modes happen one component at a time, conditioned on golden-set metrics.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type {
|
|
12
|
+
import type { ComponentTag } from "@mailwoman/codex/component"
|
|
13
|
+
|
|
14
|
+
import type { ClassificationProposal } from "#types"
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* How a component is sourced.
|
package/lib/policy/registry.ts
CHANGED
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
* per-locale overrides at startup. Look-up and `apply` are pure.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import type { ComponentTag } from "@mailwoman/codex/component"
|
|
14
|
+
|
|
13
15
|
import { buildDefaultPolicies, defaultPolicyFor } from "#policy/defaults"
|
|
14
16
|
import type { ClassifierPolicy, PolicyMode, PolicyRegistry } from "#policy/policy"
|
|
15
|
-
import type { ClassificationProposal
|
|
17
|
+
import type { ClassificationProposal } from "#types"
|
|
16
18
|
|
|
17
19
|
const GLOBAL_LOCALE_KEY = "*"
|
|
18
20
|
|
package/lib/process.ts
CHANGED
|
@@ -110,7 +110,9 @@ export async function runFile(
|
|
|
110
110
|
/**
|
|
111
111
|
* Options for {@linkcode runFileSync}: the builtin's. Output is always decoded as UTF-8.
|
|
112
112
|
*/
|
|
113
|
-
export
|
|
113
|
+
export interface RunFileSyncOptions extends Omit<ExecFileSyncOptions, "cwd"> {
|
|
114
|
+
cwd?: PathBuilderLike
|
|
115
|
+
}
|
|
114
116
|
|
|
115
117
|
/**
|
|
116
118
|
* {@linkcode runFile} for a synchronous slot. Answers stdout; throws on a non-zero exit, with the builtin's error.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* package; these shapes are what every adapter maps INTO.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import type { ComponentTag } from "
|
|
25
|
+
import type { ComponentTag } from "@mailwoman/codex/component"
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* One parsed component as the provider receives it: the tag, the surface text, and where in the normalized query it
|
package/lib/resolver/index.ts
CHANGED
|
@@ -44,14 +44,7 @@ export {
|
|
|
44
44
|
type FixtureAuthoritativeRule,
|
|
45
45
|
} from "#resolver/fixture-authoritative-provider"
|
|
46
46
|
|
|
47
|
-
export {
|
|
48
|
-
DEFAULT_PLACETYPE_MAP,
|
|
49
|
-
PLACETYPE_FILTER_GROUPS,
|
|
50
|
-
expandPlacetypeFilter,
|
|
51
|
-
hardCountrySafelistFromCoverage,
|
|
52
|
-
isPlacetypeFallback,
|
|
53
|
-
placetypeMapForCountry,
|
|
54
|
-
} from "#resolver/types"
|
|
47
|
+
export { hardCountrySafelistFromCoverage } from "#resolver/types"
|
|
55
48
|
|
|
56
49
|
export type {
|
|
57
50
|
AddressPointHit,
|
|
@@ -64,7 +57,6 @@ export type {
|
|
|
64
57
|
GazetteerArtifactCoverage,
|
|
65
58
|
InterpolatedPointHit,
|
|
66
59
|
InterpolationLookup,
|
|
67
|
-
PlacetypeMap,
|
|
68
60
|
PostcodePrefixAncestor,
|
|
69
61
|
PostcodePrefixIndexLike,
|
|
70
62
|
PostcodePrefixNode,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The one registry of synthetic place-id ranges.
|
|
6
|
+
*
|
|
7
|
+
* A real WOF id is below 2e9. Every other source a gazetteer artifact folds in mints its own ids from a base high
|
|
8
|
+
* above that, and the bases must be pairwise distinct: the candidate table's `candidate_ancestor` and
|
|
9
|
+
* `candidate_interval` sidecars are keyed by `spr_id` alone, a result's `placeID` is `wof:<spr_id>`, and the
|
|
10
|
+
* backend's `ancestors(id)` answers whichever row wrote last. Two builders that pick the same base give two places
|
|
11
|
+
* one id — which happened twice while each builder kept its own list of the ranges it believed were taken
|
|
12
|
+
* (NZ localities and Code-Point Open both at 9.7e12, 3,033 shared ids in the served table; CZ districts and the NI
|
|
13
|
+
* OSM postcodes both at 9.8e12). A docstring cannot enforce distinctness; this module and its test do.
|
|
14
|
+
*
|
|
15
|
+
* Add a range here, never at the builder. Each holds at least 5e10 ids against a largest occupancy of 1.75 M
|
|
16
|
+
* (Code-Point Open), so spacing is not the constraint; the registry is.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Overture-sourced admin rows (`fold-overture`). Above any real WOF id.
|
|
21
|
+
*/
|
|
22
|
+
export const OVERTURE_ID_BASE = 8_000_000_000_000
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The GeoNames alias fold (`@mailwoman/resolver-wof-sqlite/geonames`).
|
|
26
|
+
*/
|
|
27
|
+
export const GEONAMES_ID_BASE = 9_000_000_000_000
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* GeoNames postal rows (`@mailwoman/resolver-wof-sqlite/geonames`).
|
|
31
|
+
*/
|
|
32
|
+
export const GEONAMES_POSTAL_ID_BASE = 9_500_000_000_000
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The Dutch PC6 postcode database (`gazetteer build nl-pc6`).
|
|
36
|
+
*/
|
|
37
|
+
export const NL_PC6_ID_BASE = 9_600_000_000_000
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The LINZ-derived New Zealand locality database (`gazetteer build nz-localities`).
|
|
41
|
+
*/
|
|
42
|
+
export const NZ_LOCALITY_ID_BASE = 9_650_000_000_000
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Code-Point Open, the GB postcode database (`gazetteer build postcode-codepoint`).
|
|
46
|
+
*/
|
|
47
|
+
export const CODEPOINT_ID_BASE = 9_700_000_000_000
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The Northern Ireland OSM postcode database (`gazetteer build postcode-ni-osm`).
|
|
51
|
+
*/
|
|
52
|
+
export const NI_OSM_ID_BASE = 9_800_000_000_000
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The Prague municipal districts (`gazetteer build cz-districts`).
|
|
56
|
+
*/
|
|
57
|
+
export const CZ_DISTRICT_ID_BASE = 9_850_000_000_000
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Taiwan's 鄉鎮市區 from the civil-affairs register (`gazetteer build tw-districts`).
|
|
61
|
+
*/
|
|
62
|
+
export const TW_DISTRICT_ID_BASE = 9_900_000_000_000
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Every synthetic range, ascending. The test over this table is what keeps the bases distinct and spaced; a builder
|
|
66
|
+
* reads its own constant above and never this list.
|
|
67
|
+
*/
|
|
68
|
+
export const SYNTHETIC_ID_RANGES: ReadonlyArray<{ readonly name: string; readonly base: number }> = [
|
|
69
|
+
{ name: "overture", base: OVERTURE_ID_BASE },
|
|
70
|
+
{ name: "geonames", base: GEONAMES_ID_BASE },
|
|
71
|
+
{ name: "geonames-postal", base: GEONAMES_POSTAL_ID_BASE },
|
|
72
|
+
{ name: "nl-pc6", base: NL_PC6_ID_BASE },
|
|
73
|
+
{ name: "nz-locality", base: NZ_LOCALITY_ID_BASE },
|
|
74
|
+
{ name: "codepoint", base: CODEPOINT_ID_BASE },
|
|
75
|
+
{ name: "ni-osm", base: NI_OSM_ID_BASE },
|
|
76
|
+
{ name: "cz-district", base: CZ_DISTRICT_ID_BASE },
|
|
77
|
+
{ name: "tw-district", base: TW_DISTRICT_ID_BASE },
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The smallest room any range is given before the next base. Code-Point Open, the largest occupant, holds 1.75 M ids.
|
|
82
|
+
*/
|
|
83
|
+
export const SYNTHETIC_ID_RANGE_MIN_WIDTH = 50_000_000_000
|
package/lib/resolver/types.ts
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* groups that moved to siblings are re-exported here rather than requiring every importer to move with them.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import type { PlacetypeMap } from "@mailwoman/codex/placetype-map"
|
|
20
|
+
|
|
19
21
|
import type { AddressTree } from "#decoder/types"
|
|
20
22
|
import type { GazetteerArtifactCoverage } from "#resolver/coverage-facts"
|
|
21
23
|
import type {
|
|
@@ -24,7 +26,6 @@ import type {
|
|
|
24
26
|
PostcodePrefixIndexLike,
|
|
25
27
|
StreetCentroidLookup,
|
|
26
28
|
} from "#resolver/lookup-types"
|
|
27
|
-
import type { PlacetypeMap } from "#resolver/placetype-map"
|
|
28
29
|
|
|
29
30
|
export type { CountryBBoxFact, CountryCoverageFact, GazetteerArtifactCoverage } from "#resolver/coverage-facts"
|
|
30
31
|
export { hardCountrySafelistFromCoverage } from "#resolver/coverage-facts"
|
|
@@ -41,15 +42,6 @@ export type {
|
|
|
41
42
|
StreetCentroidLookup,
|
|
42
43
|
} from "#resolver/lookup-types"
|
|
43
44
|
|
|
44
|
-
export {
|
|
45
|
-
DEFAULT_PLACETYPE_MAP,
|
|
46
|
-
expandPlacetypeFilter,
|
|
47
|
-
isPlacetypeFallback,
|
|
48
|
-
PLACETYPE_FILTER_GROUPS,
|
|
49
|
-
placetypeMapForCountry,
|
|
50
|
-
type PlacetypeMap,
|
|
51
|
-
} from "#resolver/placetype-map"
|
|
52
|
-
|
|
53
45
|
/**
|
|
54
46
|
* One candidate place returned by a resolver. Mirrors the shape used by `@mailwoman/core/resolver-wof-sqlite`'s
|
|
55
47
|
* `PlaceCandidate` — kept structurally compatible so a callsite holding a `PlaceCandidate` can be passed where a
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import FastGlob from "fast-glob"
|
|
8
7
|
import type { PathBuilder } from "path-ts"
|
|
9
8
|
import { parallelMap } from "spliterator"
|
|
9
|
+
import { Globerator } from "spliterator/node/fs"
|
|
10
10
|
|
|
11
11
|
import { readLocalTextFile } from "#fs/readers"
|
|
12
12
|
import { parseJSONStrict } from "#json"
|
|
@@ -74,15 +74,14 @@ export class Placetype implements Disposable {
|
|
|
74
74
|
|
|
75
75
|
if (!exists) return
|
|
76
76
|
|
|
77
|
-
const definitionPaths =
|
|
78
|
-
cwd: repoDirectory("placetypes")
|
|
79
|
-
absolute: true,
|
|
77
|
+
const definitionPaths = Globerator.from("*.json", {
|
|
78
|
+
cwd: repoDirectory("placetypes"),
|
|
80
79
|
})
|
|
81
80
|
|
|
82
81
|
const batchIterator = parallelMap(
|
|
83
82
|
definitionPaths,
|
|
84
83
|
async (definitionPath) => {
|
|
85
|
-
const definitionContent = await readLocalTextFile(
|
|
84
|
+
const definitionContent = await readLocalTextFile(definitionPath)
|
|
86
85
|
const definition = parseJSONStrict<PlacetypeDefinition>(definitionContent)
|
|
87
86
|
|
|
88
87
|
Placetype.register(definition)
|
|
@@ -92,7 +91,9 @@ export class Placetype implements Disposable {
|
|
|
92
91
|
{ concurrency: batchSize }
|
|
93
92
|
)
|
|
94
93
|
|
|
95
|
-
await
|
|
94
|
+
for await (const _definition of batchIterator) {
|
|
95
|
+
// `parallelMap` performs registration above; its yielded definitions have no further consumer.
|
|
96
|
+
}
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
/**
|
|
@@ -63,6 +63,40 @@ export function requiredArgument(scope: string, name: string, value: string | un
|
|
|
63
63
|
return value
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Kebab segments whose property spelling capitalizes the whole acronym, per the house casing convention.
|
|
68
|
+
*
|
|
69
|
+
* A segment missing here derives a property the command's own `Options` does not declare. The flag still parses and
|
|
70
|
+
* still passes validation; it reaches the component under a name nothing reads, so it does nothing and reports no
|
|
71
|
+
* error. Add the segment here when a flag carries an acronym.
|
|
72
|
+
*/
|
|
73
|
+
const OPTION_INITIALISMS = new Map([
|
|
74
|
+
["csv", "CSV"],
|
|
75
|
+
["db", "DB"],
|
|
76
|
+
["html", "HTML"],
|
|
77
|
+
["ids", "IDs"],
|
|
78
|
+
["json", "JSON"],
|
|
79
|
+
["jsonl", "JSONL"],
|
|
80
|
+
["km", "KM"],
|
|
81
|
+
["svg", "SVG"],
|
|
82
|
+
["xml", "XML"],
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Convert a kebab-case option name to its TypeScript property name.
|
|
87
|
+
*
|
|
88
|
+
* `@mailwoman/repo-health`'s `cli-flag-properties` check derives every command's property names with this function, so
|
|
89
|
+
* a flag whose property nothing declares fails a check rather than doing nothing at runtime.
|
|
90
|
+
*/
|
|
91
|
+
export function optionPropertyName(value: string): string {
|
|
92
|
+
const [head = "", ...tail] = value.split("-")
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
head +
|
|
96
|
+
tail.map((part) => OPTION_INITIALISMS.get(part) ?? `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join("")
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
66
100
|
export function parseArguments<T extends ParseArgsConfig>(config: T): ReturnType<typeof parseArgs<T>> {
|
|
67
101
|
// The builtin types its result from the whole config object, so supplying `args` moves the type; the parsed shape
|
|
68
102
|
// depends on `options`/`allowPositionals` alone, which `T` carries.
|
|
@@ -3,7 +3,7 @@ import { defaultRegistry } from "async-init"
|
|
|
3
3
|
import { ResourceError } from "#errors/schema"
|
|
4
4
|
import { ConsoleLogger } from "#logging"
|
|
5
5
|
|
|
6
|
-
export { cliArguments, passThroughCLIArguments, scriptEntryPath } from "#scripting/arguments"
|
|
6
|
+
export { cliArguments, optionPropertyName, passThroughCLIArguments, scriptEntryPath } from "#scripting/arguments"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Print a message to stderr and exit non-zero. Typed `never`, so a caller gets definite-assignment narrowing after the
|
package/lib/strings/case.ts
CHANGED
|
@@ -7,8 +7,19 @@
|
|
|
7
7
|
import { camelCase, capitalCase, snakeCase } from "change-case"
|
|
8
8
|
import type { CamelCase, SnakeCase } from "type-fest"
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Any character that is not a letter, a digit, or an underscore, in ANY script.
|
|
12
|
+
*
|
|
13
|
+
* `\W` cannot serve: it is `[^A-Za-z0-9_]` in JavaScript with or without the `u` flag, so every character of a
|
|
14
|
+
* non-Latin name is "non-word" and the name is replaced rather than kept.
|
|
15
|
+
*/
|
|
16
|
+
const NON_KEY_CHARACTER = /[^\p{L}\p{N}_]+/gu
|
|
17
|
+
|
|
10
18
|
/**
|
|
11
19
|
* Converts a name to snake_case, unless the name is already in all caps.
|
|
20
|
+
*
|
|
21
|
+
* A caseless script takes the all-caps branch, because `toUpperCase()` is the identity on Korean, Japanese, Chinese,
|
|
22
|
+
* Hebrew and Arabic. That is the right branch — those names have no case to convert and survive as written.
|
|
12
23
|
*/
|
|
13
24
|
export function smartSnakeCase<T extends string>(name: T): T extends Uppercase<T> ? T : SnakeCase<T> {
|
|
14
25
|
const normalizedName = name
|
|
@@ -19,8 +30,8 @@ export function smartSnakeCase<T extends string>(name: T): T extends Uppercase<T
|
|
|
19
30
|
if (normalizedName.toUpperCase() === normalizedName) {
|
|
20
31
|
return (
|
|
21
32
|
normalizedName
|
|
22
|
-
// Replace
|
|
23
|
-
.replaceAll(
|
|
33
|
+
// Replace everything that cannot be part of a key with underscores...
|
|
34
|
+
.replaceAll(NON_KEY_CHARACTER, "_")
|
|
24
35
|
// ...and then replace all sequences of underscores with a single underscore.
|
|
25
36
|
.replaceAll(/_{2,}/g, "_") as T extends Uppercase<T> ? T : SnakeCase<T>
|
|
26
37
|
)
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// Import `Sequence` from its leaf module, NOT the `@mailwoman/core/resources` barrel: the barrel
|
|
8
|
-
// re-exports the libpostal/WOF dictionaries (top-level `readdir` + fast-glob, Node-only), which would
|
|
9
|
-
// drag the entire resource-loading layer into any browser bundle that touches tokenization — and
|
|
10
|
-
// `@mailwoman/phrase-grouper` touches it via `Span`. `Sequence` itself is a pure `extends Set`.
|
|
11
7
|
import { Sequence } from "#resources/set"
|
|
12
8
|
|
|
9
|
+
/**
|
|
10
|
+
* A graph node is a weakly-keyed object that can be stored in a graph.
|
|
11
|
+
*/
|
|
13
12
|
export type GraphNodeCallback<G> = (node: G) => boolean
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
import { join } from "path-ts"
|
|
28
|
+
import { Globerator } from "spliterator/node/fs"
|
|
28
29
|
|
|
29
|
-
import { isDirectory,
|
|
30
|
+
import { isDirectory, readLocalTextFile } from "#fs/readers"
|
|
30
31
|
import { temporaryDirectory } from "#fs/temporary"
|
|
31
32
|
import { copyPath, removePathIfPresent, writeLocalTextFile } from "#fs/writers"
|
|
32
33
|
import { CommandError } from "#scripting/command"
|
|
@@ -82,7 +83,7 @@ export async function downloadLibpostalResources(
|
|
|
82
83
|
const sourceDicts = join(cloneDir, "resources", "dictionaries")
|
|
83
84
|
|
|
84
85
|
// Alphabetize the contents of each dictionary file in place.
|
|
85
|
-
for (const entry of
|
|
86
|
+
for await (const entry of Globerator.from("*", { cwd: sourceDicts, withFileTypes: true, onlyFiles: false })) {
|
|
86
87
|
if (entry.isFile()) {
|
|
87
88
|
await sortFileInPlace(join(sourceDicts, entry.name))
|
|
88
89
|
}
|
|
@@ -66,10 +66,9 @@ export async function generateLanguageTypes(
|
|
|
66
66
|
|
|
67
67
|
report?.(`Reading ${dataSourcePath}`)
|
|
68
68
|
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
for await (const columns of CSVSpliterator.fromAsync(dataSourcePath, { enableQuoteHandling: true })) {
|
|
69
|
+
// `header` defaults true, which skips the `alpha3-b,alpha2,English` line; the columns are read by position, so the
|
|
70
|
+
// mode is named rather than derived from it.
|
|
71
|
+
for await (const columns of CSVSpliterator.fromAsync<string[]>(dataSourcePath, { mode: "array" })) {
|
|
73
72
|
const alpha3b = columns[0] as string
|
|
74
73
|
const alpha2 = columns[1] as string
|
|
75
74
|
const labelsConcatenated = columns[2] as string
|
package/lib/tools/index.ts
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* argv, no `process.exit`: commands own parsing, rendering, and exit codes.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export * from "#tools/download
|
|
11
|
-
export * from "#tools/download
|
|
10
|
+
export * from "#tools/download/libpostal-resources"
|
|
11
|
+
export * from "#tools/download/ssl-address"
|
|
12
12
|
export * from "#tools/generate-language-types"
|
package/lib/types/classifier.ts
CHANGED
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
* `@mailwoman/classifiers` workspace; this contract now describes the neural path only.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import type { ComponentTag } from "@mailwoman/codex/component"
|
|
20
|
+
|
|
19
21
|
import type { Span } from "#tokenization/index"
|
|
20
|
-
import type { ComponentTag } from "#types/component"
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Sections in Mailwoman are sub-Spans of the tokenized input (split by boundary characters: commas, line breaks, etc.).
|