@mailwoman/core 10.1.0 → 10.2.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/api/APIClient.ts +5 -6
- package/lib/api/arcgis.ts +5 -5
- package/lib/api/ckan.ts +2 -1
- package/lib/api/disk-storage.ts +3 -3
- package/lib/api/ogc.ts +56 -52
- package/lib/api/pacer.ts +1 -1
- package/lib/api/retry.ts +6 -4
- package/lib/api/test/transport.ts +20 -20
- package/lib/api.ts +1 -0
- package/lib/coarse-placer/coarse-placer.ts +4 -3
- package/lib/crypto/node.ts +1 -2
- package/lib/decoder/build-tree.ts +5 -5
- package/lib/decoder/parse-diff.ts +47 -31
- package/lib/decoder/proposals-to-tree.ts +1 -0
- package/lib/decoder/serialize/json.ts +9 -6
- package/lib/decoder/serialize/tuples.ts +2 -1
- package/lib/decoder/serialize/xml.ts +15 -14
- package/lib/decoder/tree/shape.ts +14 -14
- package/lib/decoder/tree/walk.ts +2 -2
- package/lib/decoder/types.ts +48 -2
- package/lib/env/schema.ts +21 -23
- package/lib/env/utils.ts +4 -3
- package/lib/env.ts +4 -4
- package/lib/fs/delimited.ts +35 -1
- package/lib/fs/readers.ts +2 -5
- package/lib/fs/zip.ts +1 -1
- package/lib/geocode/result.ts +337 -0
- package/lib/git.ts +1 -1
- package/lib/html/document.ts +6 -6
- package/lib/html/elements.ts +26 -23
- package/lib/identical.ts +20 -0
- package/lib/json.ts +5 -7
- package/lib/layers/coverage.ts +28 -1
- package/lib/layers/feature-count.ts +3 -3
- package/lib/layers/manifest.ts +22 -21
- package/lib/layers/schema.ts +25 -1
- package/lib/license/configured.ts +3 -3
- package/lib/license/key/file.ts +2 -1
- package/lib/license/key.ts +3 -3
- package/lib/license/stamp.ts +4 -4
- package/lib/locale/locale.ts +1 -1
- package/lib/locale/registry.ts +2 -2
- package/lib/module/compiled-freshness.ts +1 -1
- package/lib/module/package-command.ts +4 -2
- package/lib/module/packaged-data.ts +1 -1
- package/lib/module/resolve-from.ts +1 -1
- package/lib/numeric.ts +4 -4
- package/lib/objects.ts +3 -0
- package/lib/paths.ts +16 -1
- package/lib/pipeline/client-result.ts +14 -14
- package/lib/pipeline/result.ts +5 -4
- package/lib/pipeline/runtime-pipeline.ts +65 -42
- package/lib/pipeline/span-proposer.ts +1 -1
- package/lib/pipeline/types.ts +328 -161
- package/lib/pipeline.ts +32 -7
- package/lib/policy/proposal-collection.ts +1 -1
- package/lib/policy/registry.ts +5 -3
- package/lib/resolver/authoritative-provider.ts +17 -17
- package/lib/resolver/coverage-facts.ts +3 -3
- package/lib/resolver/fixture-authoritative-provider.ts +4 -0
- package/lib/resolver/lookup-types.ts +54 -14
- package/lib/resolver/postcode-format.ts +9 -9
- package/lib/resolver/referential.ts +2 -2
- package/lib/resolver/types.ts +155 -51
- package/lib/resolver.ts +22 -20
- package/lib/resources/git.ts +1 -1
- package/lib/resources/languages.ts +0 -2
- package/lib/resources/libpostal.ts +1 -1
- package/lib/resources/whosonfirst/PlacetypeDataSource.ts +2 -6
- package/lib/resources/whosonfirst/extract-repo.ts +2 -1
- package/lib/resources/whosonfirst/placetypes/admin.ts +20 -25
- package/lib/resources/whosonfirst/placetypes/mermaid.ts +4 -3
- package/lib/resources/whosonfirst/placetypes/specificity.ts +7 -7
- package/lib/resources.ts +1 -0
- package/lib/scripting/arguments.ts +6 -5
- package/lib/scripting/command.ts +3 -2
- package/lib/scripting/operation.ts +2 -2
- package/lib/scripting/utils.ts +3 -5
- package/lib/strings/python-json.ts +1 -1
- package/lib/tokenization/Span.ts +1 -1
- package/lib/trust-policies.ts +0 -2
- package/lib/types/Classification.ts +1 -1
- package/lib/types/classifier.ts +1 -1
- package/lib/utils/geodatabase-archive.ts +13 -5
- package/lib/utils/sqlite-rows.ts +3 -3
- package/lib/utils/stream-to-disk.ts +1 -3
- package/lib/utils/union-find.ts +1 -1
- package/lib/vale.ts +1 -1
- package/lib/workspaces.ts +2 -2
- package/out/api/APIClient.d.ts +3 -3
- package/out/api/APIClient.d.ts.map +1 -1
- package/out/api/APIClient.js +2 -3
- package/out/api/APIClient.js.map +1 -1
- package/out/api/arcgis.d.ts +2 -2
- package/out/api/arcgis.d.ts.map +1 -1
- package/out/api/arcgis.js +6 -6
- package/out/api/arcgis.js.map +1 -1
- package/out/api/ckan.d.ts +2 -1
- package/out/api/ckan.d.ts.map +1 -1
- package/out/api/ckan.js.map +1 -1
- package/out/api/disk-storage.d.ts +1 -1
- package/out/api/disk-storage.js +2 -2
- package/out/api/disk-storage.js.map +1 -1
- package/out/api/ogc.d.ts +32 -27
- package/out/api/ogc.d.ts.map +1 -1
- package/out/api/ogc.js +41 -46
- package/out/api/ogc.js.map +1 -1
- package/out/api/pacer.d.ts +1 -1
- package/out/api/pacer.js +1 -1
- package/out/api/retry.d.ts +6 -4
- package/out/api/retry.d.ts.map +1 -1
- package/out/api/retry.js +1 -1
- package/out/api/retry.js.map +1 -1
- package/out/api/test/transport.d.ts +11 -11
- package/out/api/test/transport.d.ts.map +1 -1
- package/out/api/test/transport.js +16 -16
- package/out/api/test/transport.js.map +1 -1
- package/out/api.d.ts +1 -0
- package/out/api.d.ts.map +1 -1
- package/out/api.js +1 -0
- package/out/api.js.map +1 -1
- package/out/coarse-placer/coarse-placer.d.ts +3 -2
- package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
- package/out/coarse-placer/coarse-placer.js +1 -1
- package/out/coarse-placer/coarse-placer.js.map +1 -1
- package/out/crypto/node.d.ts +1 -2
- package/out/crypto/node.d.ts.map +1 -1
- package/out/crypto/node.js +1 -2
- package/out/crypto/node.js.map +1 -1
- package/out/decoder/build-tree.js +5 -5
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/parse-diff.d.ts +19 -19
- package/out/decoder/parse-diff.d.ts.map +1 -1
- package/out/decoder/parse-diff.js +28 -12
- package/out/decoder/parse-diff.js.map +1 -1
- package/out/decoder/proposals-to-tree.d.ts.map +1 -1
- package/out/decoder/proposals-to-tree.js +1 -0
- package/out/decoder/proposals-to-tree.js.map +1 -1
- package/out/decoder/serialize/json.d.ts +35 -17
- package/out/decoder/serialize/json.d.ts.map +1 -1
- package/out/decoder/serialize/json.js +28 -0
- package/out/decoder/serialize/json.js.map +1 -1
- package/out/decoder/serialize/tuples.d.ts +2 -1
- 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 +12 -11
- package/out/decoder/serialize/xml.d.ts.map +1 -1
- package/out/decoder/serialize/xml.js +3 -3
- package/out/decoder/serialize/xml.js.map +1 -1
- package/out/decoder/tree/shape.d.ts +6 -6
- package/out/decoder/tree/shape.d.ts.map +1 -1
- package/out/decoder/tree/shape.js +8 -8
- package/out/decoder/tree/shape.js.map +1 -1
- package/out/decoder/tree/walk.d.ts +1 -1
- package/out/decoder/tree/walk.d.ts.map +1 -1
- package/out/decoder/tree/walk.js +1 -1
- package/out/decoder/tree/walk.js.map +1 -1
- package/out/decoder/types.d.ts +55 -2
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +39 -1
- package/out/decoder/types.js.map +1 -1
- package/out/env/schema.d.ts +11 -12
- package/out/env/schema.d.ts.map +1 -1
- package/out/env/schema.js +15 -17
- package/out/env/schema.js.map +1 -1
- package/out/env/utils.d.ts +2 -2
- package/out/env/utils.d.ts.map +1 -1
- package/out/env/utils.js +2 -2
- package/out/env/utils.js.map +1 -1
- package/out/env.js +4 -4
- package/out/env.js.map +1 -1
- package/out/fs/delimited.d.ts +18 -0
- package/out/fs/delimited.d.ts.map +1 -1
- package/out/fs/delimited.js +31 -1
- package/out/fs/delimited.js.map +1 -1
- package/out/fs/readers.d.ts +2 -4
- package/out/fs/readers.d.ts.map +1 -1
- package/out/fs/readers.js +2 -4
- package/out/fs/readers.js.map +1 -1
- package/out/fs/zip.js +1 -1
- package/out/fs/zip.js.map +1 -1
- package/out/geocode/result.d.ts +475 -0
- package/out/geocode/result.d.ts.map +1 -0
- package/out/geocode/result.js +280 -0
- package/out/geocode/result.js.map +1 -0
- package/out/git.js +1 -1
- package/out/git.js.map +1 -1
- package/out/html/document.d.ts +3 -3
- package/out/html/document.d.ts.map +1 -1
- package/out/html/document.js +4 -4
- package/out/html/document.js.map +1 -1
- package/out/html/elements.d.ts +18 -15
- package/out/html/elements.d.ts.map +1 -1
- package/out/html/elements.js +17 -16
- package/out/html/elements.js.map +1 -1
- package/out/identical.d.ts +16 -0
- package/out/identical.d.ts.map +1 -0
- package/out/identical.js +19 -0
- package/out/identical.js.map +1 -0
- package/out/json.d.ts +3 -5
- package/out/json.d.ts.map +1 -1
- package/out/json.js +3 -5
- package/out/json.js.map +1 -1
- package/out/layers/coverage.d.ts +26 -1
- package/out/layers/coverage.d.ts.map +1 -1
- package/out/layers/coverage.js.map +1 -1
- package/out/layers/feature-count.d.ts +1 -1
- package/out/layers/feature-count.d.ts.map +1 -1
- package/out/layers/feature-count.js +2 -2
- package/out/layers/feature-count.js.map +1 -1
- package/out/layers/manifest.d.ts +11 -10
- package/out/layers/manifest.d.ts.map +1 -1
- package/out/layers/manifest.js +12 -13
- package/out/layers/manifest.js.map +1 -1
- package/out/layers/schema.d.ts +23 -0
- package/out/layers/schema.d.ts.map +1 -1
- package/out/layers/schema.js +1 -1
- package/out/layers/schema.js.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/key/file.d.ts.map +1 -1
- package/out/license/key/file.js +2 -1
- package/out/license/key/file.js.map +1 -1
- package/out/license/key.d.ts +1 -1
- package/out/license/key.d.ts.map +1 -1
- package/out/license/key.js +2 -2
- package/out/license/key.js.map +1 -1
- package/out/license/stamp.d.ts +2 -2
- package/out/license/stamp.d.ts.map +1 -1
- package/out/license/stamp.js +2 -2
- package/out/license/stamp.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 +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/module/compiled-freshness.js +1 -1
- package/out/module/compiled-freshness.js.map +1 -1
- package/out/module/package-command.d.ts +3 -2
- package/out/module/package-command.d.ts.map +1 -1
- package/out/module/package-command.js +3 -2
- package/out/module/package-command.js.map +1 -1
- package/out/module/packaged-data.js +1 -1
- package/out/module/packaged-data.js.map +1 -1
- package/out/module/resolve-from.js +1 -1
- package/out/module/resolve-from.js.map +1 -1
- package/out/numeric.d.ts +1 -1
- package/out/numeric.d.ts.map +1 -1
- package/out/numeric.js +3 -3
- package/out/numeric.js.map +1 -1
- package/out/objects.d.ts +3 -0
- package/out/objects.d.ts.map +1 -1
- package/out/objects.js +3 -0
- package/out/objects.js.map +1 -1
- package/out/paths.d.ts +20 -1
- package/out/paths.d.ts.map +1 -1
- package/out/paths.js +1 -1
- package/out/paths.js.map +1 -1
- package/out/pipeline/client-result.d.ts +15 -15
- package/out/pipeline/client-result.d.ts.map +1 -1
- package/out/pipeline/client-result.js +1 -1
- package/out/pipeline/result.d.ts +4 -3
- package/out/pipeline/result.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +16 -9
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +43 -27
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-proposer.js +1 -1
- package/out/pipeline/span-proposer.js.map +1 -1
- package/out/pipeline/types.d.ts +394 -175
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +199 -4
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline.d.ts +4 -2
- package/out/pipeline.d.ts.map +1 -1
- package/out/pipeline.js +1 -1
- package/out/pipeline.js.map +1 -1
- package/out/policy/proposal-collection.d.ts +1 -1
- package/out/policy/proposal-collection.d.ts.map +1 -1
- package/out/policy/proposal-collection.js.map +1 -1
- package/out/policy/registry.d.ts +3 -1
- package/out/policy/registry.d.ts.map +1 -1
- package/out/policy/registry.js +4 -2
- package/out/policy/registry.js.map +1 -1
- package/out/resolver/authoritative-provider.d.ts +17 -17
- package/out/resolver/authoritative-provider.d.ts.map +1 -1
- package/out/resolver/authoritative-provider.js +2 -2
- package/out/resolver/coverage-facts.d.ts +3 -3
- package/out/resolver/coverage-facts.d.ts.map +1 -1
- package/out/resolver/fixture-authoritative-provider.d.ts.map +1 -1
- package/out/resolver/fixture-authoritative-provider.js +4 -0
- package/out/resolver/fixture-authoritative-provider.js.map +1 -1
- package/out/resolver/lookup-types.d.ts +52 -15
- package/out/resolver/lookup-types.d.ts.map +1 -1
- package/out/resolver/postcode-format.d.ts +3 -3
- package/out/resolver/postcode-format.d.ts.map +1 -1
- package/out/resolver/postcode-format.js +7 -7
- package/out/resolver/postcode-format.js.map +1 -1
- package/out/resolver/referential.d.ts +2 -2
- package/out/resolver/referential.d.ts.map +1 -1
- package/out/resolver/types.d.ts +126 -40
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +43 -1
- package/out/resolver/types.js.map +1 -1
- package/out/resolver.d.ts +5 -3
- package/out/resolver.d.ts.map +1 -1
- package/out/resolver.js +2 -2
- package/out/resolver.js.map +1 -1
- package/out/resources/git.js +1 -1
- package/out/resources/git.js.map +1 -1
- package/out/resources/languages.d.ts +0 -1
- package/out/resources/languages.d.ts.map +1 -1
- package/out/resources/languages.js +0 -1
- package/out/resources/languages.js.map +1 -1
- package/out/resources/libpostal.d.ts +1 -1
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js +2 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
- package/out/resources/whosonfirst/extract-repo.d.ts.map +1 -1
- package/out/resources/whosonfirst/extract-repo.js +2 -1
- package/out/resources/whosonfirst/extract-repo.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +12 -12
- package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.js +9 -8
- package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts +2 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/specificity.d.ts +3 -3
- package/out/resources/whosonfirst/placetypes/specificity.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/specificity.js +6 -6
- package/out/resources/whosonfirst/placetypes/specificity.js.map +1 -1
- package/out/resources.d.ts +1 -0
- package/out/resources.d.ts.map +1 -1
- package/out/resources.js +1 -0
- package/out/resources.js.map +1 -1
- package/out/scripting/arguments.d.ts +5 -4
- package/out/scripting/arguments.d.ts.map +1 -1
- package/out/scripting/arguments.js +5 -4
- package/out/scripting/arguments.js.map +1 -1
- package/out/scripting/command.d.ts +2 -2
- package/out/scripting/command.d.ts.map +1 -1
- package/out/scripting/command.js +1 -0
- package/out/scripting/command.js.map +1 -1
- package/out/scripting/operation.d.ts +1 -1
- package/out/scripting/operation.d.ts.map +1 -1
- package/out/scripting/operation.js +1 -1
- package/out/scripting/operation.js.map +1 -1
- package/out/scripting/utils.d.ts +3 -4
- package/out/scripting/utils.d.ts.map +1 -1
- package/out/scripting/utils.js +3 -4
- package/out/scripting/utils.js.map +1 -1
- package/out/strings/python-json.js +1 -1
- package/out/strings/python-json.js.map +1 -1
- package/out/tokenization/Span.d.ts +1 -1
- package/out/tokenization/Span.d.ts.map +1 -1
- package/out/tools/coarse-placer/build/dataset.d.ts +4 -2
- package/out/tools/coarse-placer/build/dataset.d.ts.map +1 -1
- package/out/tools/coarse-placer/build/dataset.js.map +1 -1
- package/out/tools/coarse-placer/build/outlier/exposure.d.ts +5 -3
- package/out/tools/coarse-placer/build/outlier/exposure.d.ts.map +1 -1
- package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
- package/out/tools/coarse-placer/build/outlier/latin.d.ts +3 -3
- package/out/tools/coarse-placer/build/outlier/oa.d.ts +3 -3
- package/out/tools/coarse-placer/eval/latin-offmap.d.ts +3 -3
- package/out/tools/coarse-placer/eval/openset.js +2 -2
- package/out/tools/coarse-placer/eval/openset.js.map +1 -1
- package/out/tools/coarse-placer/eval/quant-compare.d.ts +4 -4
- package/out/tools/coarse-placer/eval.d.ts +3 -3
- package/out/tools/coarse-placer/paths.js +1 -1
- package/out/tools/coarse-placer/paths.js.map +1 -1
- package/out/tools/coarse-placer/probe-frontier.d.ts +2 -2
- package/out/tools/coarse-placer/quantize.d.ts +2 -2
- package/out/tools/coarse-placer/train.d.ts +5 -5
- package/out/tools/download/libpostal-resources.d.ts.map +1 -1
- package/out/tools/download/libpostal-resources.js +2 -1
- package/out/tools/download/libpostal-resources.js.map +1 -1
- package/out/tools/download/ssl-address.d.ts +2 -2
- package/out/tools/generate-language-types.d.ts +1 -1
- package/out/tools/generate-language-types.js +1 -1
- package/out/tools/generate-language-types.js.map +1 -1
- package/out/trust-policies.d.ts +0 -1
- package/out/trust-policies.d.ts.map +1 -1
- package/out/trust-policies.js +0 -1
- package/out/trust-policies.js.map +1 -1
- package/out/types/Classification.d.ts +1 -1
- 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/utils/geodatabase-archive.d.ts +11 -4
- package/out/utils/geodatabase-archive.d.ts.map +1 -1
- package/out/utils/geodatabase-archive.js +1 -1
- package/out/utils/geodatabase-archive.js.map +1 -1
- package/out/utils/sqlite-rows.d.ts +2 -2
- package/out/utils/sqlite-rows.d.ts.map +1 -1
- package/out/utils/sqlite-rows.js +2 -2
- package/out/utils/sqlite-rows.js.map +1 -1
- package/out/utils/stream-to-disk.d.ts.map +1 -1
- package/out/utils/stream-to-disk.js +1 -1
- package/out/utils/stream-to-disk.js.map +1 -1
- package/out/utils/union-find.js +1 -1
- package/out/utils/union-find.js.map +1 -1
- package/out/vale.js +1 -1
- package/out/vale.js.map +1 -1
- package/out/workspaces.d.ts +1 -1
- package/out/workspaces.js +1 -1
- package/out/workspaces.js.map +1 -1
- package/package.json +46 -14
- package/tools/coarse-placer/build/dataset.ts +4 -2
- package/tools/coarse-placer/build/outlier/exposure.ts +5 -3
- package/tools/coarse-placer/build/outlier/latin.ts +3 -3
- package/tools/coarse-placer/build/outlier/oa.ts +3 -3
- package/tools/coarse-placer/eval/latin-offmap.ts +3 -3
- package/tools/coarse-placer/eval/openset.ts +3 -3
- package/tools/coarse-placer/eval/quant-compare.ts +4 -4
- package/tools/coarse-placer/eval.ts +3 -3
- package/tools/coarse-placer/paths.ts +1 -1
- package/tools/coarse-placer/probe-frontier.ts +2 -2
- package/tools/coarse-placer/quantize.ts +2 -2
- package/tools/coarse-placer/train.ts +5 -5
- package/tools/download/libpostal-resources.ts +2 -1
- package/tools/download/ssl-address.ts +2 -2
- package/tools/generate-language-types.ts +3 -3
package/out/pipeline/types.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Declares the types for the runtime pipeline and its injected stages.
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { NormalizedInputLite } from "@mailwoman/query-shape";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { type AddressTree } from "#decoder/types";
|
|
9
11
|
import type { MachinePreferences } from "#pipeline/preferences";
|
|
10
12
|
import type { ResolveOpts, Resolver, ResolverBackend } from "#resolver/types";
|
|
11
13
|
import type { Section } from "#types/classifier";
|
|
12
|
-
export { type PipelineFault, type PipelineResult } from "#pipeline/result";
|
|
13
|
-
export { type MachinePreferences } from "#pipeline/preferences";
|
|
14
14
|
/**
|
|
15
15
|
* The user's location.
|
|
16
16
|
* The resolver may use it for scoring.
|
|
@@ -25,9 +25,93 @@ export type UserLocation = {
|
|
|
25
25
|
country: string;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* The placetype-pair prior for one parse.
|
|
29
|
+
*
|
|
30
|
+
* - `"inherit"` uses the classifier's configured prior, if it has one.
|
|
31
|
+
* - `"off"` disables the prior for the parse.
|
|
32
|
+
* - A prior object replaces the configured one.
|
|
33
|
+
* Core passes it to the classifier without inspecting it.
|
|
34
|
+
*/
|
|
35
|
+
export type PlacetypePairSelection<Prior extends object = object> = "inherit" | "off" | Prior;
|
|
36
|
+
/**
|
|
37
|
+
* How the classifier treats letter case before inference.
|
|
38
|
+
*
|
|
39
|
+
* - `"title-case"` title-cases detected all-caps ASCII input.
|
|
40
|
+
* Mixed-case input is unchanged.
|
|
41
|
+
* - `"preserve"` passes the raw case to the model.
|
|
42
|
+
*/
|
|
43
|
+
export type CaseNormalization = "title-case" | "preserve";
|
|
44
|
+
/**
|
|
45
|
+
* How a caller sources an optional stage.
|
|
46
|
+
*
|
|
47
|
+
* - `"auto"` loads the bundled default, usually on the first parse.
|
|
48
|
+
* - `"none"` disables the stage.
|
|
49
|
+
* - Any other value is the stage itself.
|
|
50
|
+
*/
|
|
51
|
+
export type StageSource<T extends object> = "auto" | "none" | T;
|
|
52
|
+
/**
|
|
53
|
+
* How the pipeline uses the coarse placer's country guess.
|
|
54
|
+
*
|
|
55
|
+
* - `"filter"` turns a confident guess for a country in the hard-country safelist
|
|
56
|
+
* into a hard country filter, and keeps the soft prior otherwise.
|
|
57
|
+
* - `"prior"` only adds the guess as a soft country prior.
|
|
58
|
+
*/
|
|
59
|
+
export type PlacerCountryUse = "filter" | "prior";
|
|
60
|
+
/**
|
|
61
|
+
* The placer-country use every parse and geocode applies unless a caller chooses otherwise.
|
|
62
|
+
*/
|
|
63
|
+
export declare const DEFAULT_PLACER_COUNTRY_USE = "filter";
|
|
64
|
+
/**
|
|
65
|
+
* The case normalization every parse uses unless a caller chooses otherwise.
|
|
66
|
+
*/
|
|
67
|
+
export declare const DEFAULT_CASE_NORMALIZATION = "title-case";
|
|
68
|
+
/**
|
|
69
|
+
* Every {@link CaseNormalization} value, for flag choices and validation.
|
|
70
|
+
*/
|
|
71
|
+
export declare const CASE_NORMALIZATIONS: readonly ["title-case", "preserve"];
|
|
72
|
+
/**
|
|
73
|
+
* Reads a flag value as a {@link CaseNormalization}, falling back to
|
|
74
|
+
* {@link DEFAULT_CASE_NORMALIZATION} when unset and throwing on anything else.
|
|
75
|
+
*/
|
|
76
|
+
export declare function caseNormalizationOf(value: string | undefined): CaseNormalization;
|
|
77
|
+
/**
|
|
78
|
+
* Limits which words the word-consistency repair relabels.
|
|
79
|
+
*
|
|
80
|
+
* An empty object relabels every word whose pieces disagree on entity type.
|
|
29
81
|
*/
|
|
30
|
-
export
|
|
82
|
+
export interface WordConsistencyOpts {
|
|
83
|
+
/**
|
|
84
|
+
* Leaves a word unchanged when the winning type's mean probability across its
|
|
85
|
+
* pieces falls below this floor; `0` or unset never skips.
|
|
86
|
+
*
|
|
87
|
+
* A low-confidence vote marks rows where per-piece confidence is unreliable.
|
|
88
|
+
* A relabelled row would amplify noise.
|
|
89
|
+
*/
|
|
90
|
+
minMeanConfidence?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Leaves any word containing a byte-fallback piece (`<0xNN>`) unchanged.
|
|
93
|
+
*
|
|
94
|
+
* Its surviving pieces are not trustworthy voters.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue `false`
|
|
97
|
+
*/
|
|
98
|
+
skipByteFallbackWords?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Treats a punctuation-only piece as a word separator, like whitespace.
|
|
101
|
+
*
|
|
102
|
+
* Otherwise a continuation piece such as the `,` in `Ave,` joins the word.
|
|
103
|
+
* Its `O` label can outvote a real span.
|
|
104
|
+
*
|
|
105
|
+
* The halves of a slash compound such as `12/345` can also vote independently.
|
|
106
|
+
*
|
|
107
|
+
* @defaultValue `false`
|
|
108
|
+
*/
|
|
109
|
+
splitOnPunctuation?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The word-consistency repair setting: `"off"`, or the options of the vote to run.
|
|
113
|
+
*/
|
|
114
|
+
export type WordConsistencySetting = "off" | WordConsistencyOpts;
|
|
31
115
|
/**
|
|
32
116
|
* Per-call options for the runtime pipeline.
|
|
33
117
|
*/
|
|
@@ -36,9 +120,9 @@ export interface PipelineOpts {
|
|
|
36
120
|
userLocation?: UserLocation;
|
|
37
121
|
/**
|
|
38
122
|
* The input register.
|
|
39
|
-
*
|
|
123
|
+
* The default `"auto"` derives it from the query kind.
|
|
40
124
|
*/
|
|
41
|
-
inputMode?:
|
|
125
|
+
inputMode?: InputModeSelection;
|
|
42
126
|
/**
|
|
43
127
|
* Disables the postcode and locality fast paths.
|
|
44
128
|
* POI routing still applies.
|
|
@@ -50,33 +134,29 @@ export interface PipelineOpts {
|
|
|
50
134
|
*/
|
|
51
135
|
resolveOpts?: ResolveOpts;
|
|
52
136
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
137
|
+
* How the classifier treats letter case.
|
|
138
|
+
*
|
|
139
|
+
* @defaultValue {@linkcode DEFAULT_CASE_NORMALIZATION}
|
|
55
140
|
*/
|
|
56
|
-
|
|
141
|
+
caseNormalization?: CaseNormalization;
|
|
57
142
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
143
|
+
* The placetype-pair prior for this parse.
|
|
144
|
+
*
|
|
145
|
+
* The default `"inherit"` uses the classifier's configured prior.
|
|
60
146
|
*/
|
|
61
|
-
placetypePair?:
|
|
147
|
+
placetypePair?: PlacetypePairSelection;
|
|
62
148
|
/**
|
|
63
|
-
*
|
|
149
|
+
* How the coarse placer's country guess constrains resolution.
|
|
150
|
+
*
|
|
151
|
+
* @defaultValue {@linkcode DEFAULT_PLACER_COUNTRY_USE}
|
|
64
152
|
*/
|
|
65
|
-
|
|
153
|
+
placerCountryUse?: PlacerCountryUse;
|
|
66
154
|
/**
|
|
67
155
|
* Replaces the artifact's hard-country safelist.
|
|
68
156
|
*/
|
|
69
157
|
hardCountrySafelist?: ReadonlySet<string>;
|
|
70
158
|
signal?: AbortSignal;
|
|
71
159
|
}
|
|
72
|
-
/**
|
|
73
|
-
* The fields of a normalized input that the pipeline reads.
|
|
74
|
-
*/
|
|
75
|
-
export interface NormalizedInputLite {
|
|
76
|
-
raw: string;
|
|
77
|
-
normalized: string;
|
|
78
|
-
appliedLocale?: string;
|
|
79
|
-
}
|
|
80
160
|
/**
|
|
81
161
|
* The fields of a query shape that the pipeline reads.
|
|
82
162
|
*/
|
|
@@ -89,22 +169,26 @@ export interface QueryShapeLite {
|
|
|
89
169
|
};
|
|
90
170
|
confidence: number;
|
|
91
171
|
}>;
|
|
92
|
-
segments
|
|
172
|
+
segments: ReadonlyArray<{
|
|
93
173
|
body: string;
|
|
94
174
|
index: number;
|
|
95
|
-
|
|
96
|
-
|
|
175
|
+
span: {
|
|
176
|
+
start: number;
|
|
177
|
+
end: number;
|
|
178
|
+
} | null;
|
|
179
|
+
}> | null;
|
|
180
|
+
characterClass: string | null;
|
|
97
181
|
/**
|
|
98
182
|
* ISO 15924 scripts ranked by share of script-bearing characters.
|
|
99
183
|
*/
|
|
100
|
-
scripts
|
|
184
|
+
scripts: ReadonlyArray<{
|
|
101
185
|
script: string;
|
|
102
186
|
share: number;
|
|
103
|
-
}
|
|
187
|
+
}> | null;
|
|
104
188
|
/**
|
|
105
189
|
* The class and script of each token.
|
|
106
190
|
*/
|
|
107
|
-
tokenClasses
|
|
191
|
+
tokenClasses: ReadonlyArray<{
|
|
108
192
|
span: {
|
|
109
193
|
start: number;
|
|
110
194
|
end: number;
|
|
@@ -112,9 +196,9 @@ export interface QueryShapeLite {
|
|
|
112
196
|
};
|
|
113
197
|
class: string;
|
|
114
198
|
length: number;
|
|
115
|
-
script
|
|
116
|
-
}
|
|
117
|
-
totalLength
|
|
199
|
+
script: string | null;
|
|
200
|
+
}> | null;
|
|
201
|
+
totalLength: number | null;
|
|
118
202
|
}
|
|
119
203
|
/**
|
|
120
204
|
* A locale from detection or a caller hint, with alternatives.
|
|
@@ -133,42 +217,47 @@ export interface LocaleHint {
|
|
|
133
217
|
* The array is empty when the input has no script-bearing text.
|
|
134
218
|
* `locale` stays a BCP-47 language tag.
|
|
135
219
|
*/
|
|
136
|
-
script
|
|
220
|
+
script: ReadonlyArray<{
|
|
137
221
|
script: string;
|
|
138
222
|
confidence: number;
|
|
139
223
|
}>;
|
|
140
224
|
/**
|
|
141
|
-
* Diagnostic values that fed the inferred preferences.
|
|
225
|
+
* Diagnostic values that fed the inferred preferences, or null when none did.
|
|
142
226
|
* Locale and time zone are independent signals.
|
|
143
227
|
*/
|
|
144
|
-
evidence
|
|
145
|
-
intlLocale
|
|
146
|
-
timeZone
|
|
147
|
-
environmentLocale
|
|
148
|
-
};
|
|
228
|
+
evidence: {
|
|
229
|
+
intlLocale: string | null;
|
|
230
|
+
timeZone: string | null;
|
|
231
|
+
environmentLocale: Intl.UnicodeBCP47LocaleIdentifier | null;
|
|
232
|
+
} | null;
|
|
149
233
|
}
|
|
150
234
|
/**
|
|
151
235
|
* The query kinds the kind classifier emits.
|
|
152
236
|
*
|
|
153
|
-
* The last four kinds describe the requested operation instead of the input's structure
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
237
|
+
* The last four kinds describe the requested operation instead of the input's structure:
|
|
238
|
+
*
|
|
239
|
+
* - `bare_toponym`: a bare place name with no address components.
|
|
240
|
+
* Resolution uses it to report ambiguity.
|
|
241
|
+
* - `route_pair`: two place names with no address grammar between them.
|
|
242
|
+
* The pipeline reports both readings and does no routing.
|
|
243
|
+
* - `near_me`: a relative location query that needs the caller's position.
|
|
244
|
+
* - `poi_category`: a POI category query with no search anchor.
|
|
245
|
+
*/
|
|
246
|
+
export declare const QueryKindSchema: z.ZodEnum<{
|
|
247
|
+
bare_toponym: "bare_toponym";
|
|
248
|
+
intersection: "intersection";
|
|
249
|
+
landmark: "landmark";
|
|
250
|
+
locality_only: "locality_only";
|
|
251
|
+
near_me: "near_me";
|
|
252
|
+
po_box: "po_box";
|
|
253
|
+
poi_category: "poi_category";
|
|
254
|
+
poi_query: "poi_query";
|
|
255
|
+
postcode_only: "postcode_only";
|
|
256
|
+
route_pair: "route_pair";
|
|
257
|
+
structured_address: "structured_address";
|
|
258
|
+
vague: "vague";
|
|
259
|
+
}>;
|
|
260
|
+
export type QueryKind = z.infer<typeof QueryKindSchema>;
|
|
172
261
|
/**
|
|
173
262
|
* Advisory codes that report how a query was interpreted or what evidence is missing.
|
|
174
263
|
*/
|
|
@@ -204,34 +293,98 @@ export declare const QueryIntentCode: {
|
|
|
204
293
|
readonly DeclaredCoarserAnswer: "declared_coarser_answer";
|
|
205
294
|
};
|
|
206
295
|
/**
|
|
207
|
-
*
|
|
208
|
-
*/
|
|
209
|
-
export type QueryIntentCode = (typeof QueryIntentCode)[keyof typeof QueryIntentCode];
|
|
210
|
-
/**
|
|
211
|
-
* An advisory from query-intent logic.
|
|
212
|
-
* It leaves the selected answer unchanged.
|
|
296
|
+
* {@link QueryIntentCode} as a schema.
|
|
213
297
|
*/
|
|
214
|
-
export
|
|
298
|
+
export declare const QueryIntentCodeSchema: z.ZodEnum<{
|
|
215
299
|
/**
|
|
216
|
-
*
|
|
217
|
-
* It must appear in the classifier result.
|
|
300
|
+
* Resolution found no decisive candidate for a place with a recognized name.
|
|
218
301
|
*/
|
|
219
|
-
|
|
220
|
-
code: QueryIntentCode;
|
|
302
|
+
readonly DeclaredAmbiguity: "declared_ambiguity";
|
|
221
303
|
/**
|
|
222
|
-
*
|
|
304
|
+
* The query has two readings, listed in `evidence.interpretations`.
|
|
223
305
|
*/
|
|
224
|
-
|
|
306
|
+
readonly DeclaredFork: "declared_fork";
|
|
225
307
|
/**
|
|
226
|
-
*
|
|
227
|
-
* Branch on `code`, which is stable.
|
|
308
|
+
* A relative query lacks the focus point it needs.
|
|
228
309
|
*/
|
|
229
|
-
|
|
310
|
+
readonly FocusPointRequired: "focus_point_required";
|
|
230
311
|
/**
|
|
231
|
-
*
|
|
312
|
+
* The query resolved to a POI category.
|
|
232
313
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
314
|
+
readonly POICategory: "poi_category";
|
|
315
|
+
/**
|
|
316
|
+
* No matching feature exists in a cell whose coverage is complete enough to rule it out.
|
|
317
|
+
*/
|
|
318
|
+
readonly CoverageQualifiedAbsence: "coverage_qualified_absence";
|
|
319
|
+
/**
|
|
320
|
+
* An authority's designation for the resolved coordinate, backed by the authority's coverage record.
|
|
321
|
+
*/
|
|
322
|
+
readonly AuthorityDesignation: "authority_designation";
|
|
323
|
+
/**
|
|
324
|
+
* The resolved result is coarser than the parsed address.
|
|
325
|
+
* The evidence lists the unused components and both tiers.
|
|
326
|
+
*/
|
|
327
|
+
readonly DeclaredCoarserAnswer: "declared_coarser_answer";
|
|
328
|
+
}>;
|
|
329
|
+
/**
|
|
330
|
+
* One of the {@link QueryIntentCode} values.
|
|
331
|
+
*/
|
|
332
|
+
export type QueryIntentCode = z.infer<typeof QueryIntentCodeSchema>;
|
|
333
|
+
/**
|
|
334
|
+
* An advisory from query-intent logic.
|
|
335
|
+
* It leaves the selected answer unchanged.
|
|
336
|
+
*/
|
|
337
|
+
export declare const QueryIntentMarkerSchema: z.ZodObject<{
|
|
338
|
+
kind: z.ZodEnum<{
|
|
339
|
+
bare_toponym: "bare_toponym";
|
|
340
|
+
intersection: "intersection";
|
|
341
|
+
landmark: "landmark";
|
|
342
|
+
locality_only: "locality_only";
|
|
343
|
+
near_me: "near_me";
|
|
344
|
+
po_box: "po_box";
|
|
345
|
+
poi_category: "poi_category";
|
|
346
|
+
poi_query: "poi_query";
|
|
347
|
+
postcode_only: "postcode_only";
|
|
348
|
+
route_pair: "route_pair";
|
|
349
|
+
structured_address: "structured_address";
|
|
350
|
+
vague: "vague";
|
|
351
|
+
}>;
|
|
352
|
+
code: z.ZodEnum<{
|
|
353
|
+
/**
|
|
354
|
+
* Resolution found no decisive candidate for a place with a recognized name.
|
|
355
|
+
*/
|
|
356
|
+
readonly DeclaredAmbiguity: "declared_ambiguity";
|
|
357
|
+
/**
|
|
358
|
+
* The query has two readings, listed in `evidence.interpretations`.
|
|
359
|
+
*/
|
|
360
|
+
readonly DeclaredFork: "declared_fork";
|
|
361
|
+
/**
|
|
362
|
+
* A relative query lacks the focus point it needs.
|
|
363
|
+
*/
|
|
364
|
+
readonly FocusPointRequired: "focus_point_required";
|
|
365
|
+
/**
|
|
366
|
+
* The query resolved to a POI category.
|
|
367
|
+
*/
|
|
368
|
+
readonly POICategory: "poi_category";
|
|
369
|
+
/**
|
|
370
|
+
* No matching feature exists in a cell whose coverage is complete enough to rule it out.
|
|
371
|
+
*/
|
|
372
|
+
readonly CoverageQualifiedAbsence: "coverage_qualified_absence";
|
|
373
|
+
/**
|
|
374
|
+
* An authority's designation for the resolved coordinate, backed by the authority's coverage record.
|
|
375
|
+
*/
|
|
376
|
+
readonly AuthorityDesignation: "authority_designation";
|
|
377
|
+
/**
|
|
378
|
+
* The resolved result is coarser than the parsed address.
|
|
379
|
+
* The evidence lists the unused components and both tiers.
|
|
380
|
+
*/
|
|
381
|
+
readonly DeclaredCoarserAnswer: "declared_coarser_answer";
|
|
382
|
+
}>;
|
|
383
|
+
mechanism: z.ZodString;
|
|
384
|
+
message: z.ZodString;
|
|
385
|
+
evidence: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
386
|
+
}, z.core.$strip>;
|
|
387
|
+
export type QueryIntentMarker = z.infer<typeof QueryIntentMarkerSchema>;
|
|
235
388
|
/**
|
|
236
389
|
* The kind classifier's result.
|
|
237
390
|
*/
|
|
@@ -245,106 +398,170 @@ export interface QueryKindResult {
|
|
|
245
398
|
/**
|
|
246
399
|
* Advisories raised during kind classification.
|
|
247
400
|
*/
|
|
248
|
-
intentMarkers
|
|
401
|
+
intentMarkers: ReadonlyArray<QueryIntentMarker> | null;
|
|
249
402
|
}
|
|
250
403
|
/**
|
|
251
404
|
* The parse register.
|
|
252
405
|
*
|
|
253
406
|
* `fragmented` suits search input and `formatted` suits complete postal records.
|
|
407
|
+
*/
|
|
408
|
+
export declare const InputModeSchema: z.ZodEnum<{
|
|
409
|
+
formatted: "formatted";
|
|
410
|
+
fragmented: "fragmented";
|
|
411
|
+
}>;
|
|
412
|
+
export type InputMode = z.infer<typeof InputModeSchema>;
|
|
413
|
+
/**
|
|
414
|
+
* A parse register, or `"auto"` to let {@link deriveInputMode} derive it from the query kind.
|
|
415
|
+
*/
|
|
416
|
+
export declare const InputModeSelectionSchema: z.ZodEnum<{
|
|
417
|
+
auto: "auto";
|
|
418
|
+
formatted: "formatted";
|
|
419
|
+
fragmented: "fragmented";
|
|
420
|
+
}>;
|
|
421
|
+
export type InputModeSelection = z.infer<typeof InputModeSelectionSchema>;
|
|
422
|
+
/**
|
|
423
|
+
* Resolves an input-mode selection.
|
|
254
424
|
*
|
|
255
|
-
*
|
|
425
|
+
* An explicit register passes through.
|
|
426
|
+
* `"auto"` maps complete-address kinds to `formatted` and every other kind to `fragmented`.
|
|
256
427
|
*/
|
|
257
|
-
export
|
|
428
|
+
export declare function deriveInputMode(selection: InputModeSelection, kind: QueryKind): InputMode;
|
|
258
429
|
/**
|
|
259
|
-
*
|
|
430
|
+
* The relation between a POI subject and its anchor, as the query phrased it.
|
|
260
431
|
*/
|
|
261
|
-
export declare
|
|
432
|
+
export declare const POISpatialRelationSchema: z.ZodEnum<{
|
|
433
|
+
around: "around";
|
|
434
|
+
at: "at";
|
|
435
|
+
comma: "comma";
|
|
436
|
+
in: "in";
|
|
437
|
+
near: "near";
|
|
438
|
+
to: "to";
|
|
439
|
+
}>;
|
|
440
|
+
export type POISpatialRelation = z.infer<typeof POISpatialRelationSchema>;
|
|
262
441
|
/**
|
|
263
442
|
* A structured POI query that classification hands to search executors.
|
|
264
443
|
*/
|
|
265
|
-
export
|
|
266
|
-
subject: {
|
|
267
|
-
kind: "category"
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
biasPoint?: {
|
|
304
|
-
latitude: number;
|
|
305
|
-
longitude: number;
|
|
306
|
-
};
|
|
307
|
-
radiusM?: number;
|
|
308
|
-
};
|
|
309
|
-
limit?: number;
|
|
310
|
-
}
|
|
444
|
+
export declare const POIIntentSchema: z.ZodObject<{
|
|
445
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
446
|
+
kind: z.ZodLiteral<"category">;
|
|
447
|
+
categoryIDs: z.ZodArray<z.ZodString>;
|
|
448
|
+
matched: z.ZodString;
|
|
449
|
+
countryBinding: z.ZodNullable<z.ZodObject<{
|
|
450
|
+
anchorCountry: z.ZodNullable<z.ZodString>;
|
|
451
|
+
excludedCategoryIDs: z.ZodArray<z.ZodString>;
|
|
452
|
+
}, z.core.$strip>>;
|
|
453
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
454
|
+
kind: z.ZodLiteral<"brand">;
|
|
455
|
+
name: z.ZodString;
|
|
456
|
+
wikidata: z.ZodNullable<z.ZodString>;
|
|
457
|
+
matched: z.ZodString;
|
|
458
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
459
|
+
kind: z.ZodLiteral<"name">;
|
|
460
|
+
text: z.ZodString;
|
|
461
|
+
}, z.core.$strip>], "kind">;
|
|
462
|
+
relation: z.ZodNullable<z.ZodEnum<{
|
|
463
|
+
around: "around";
|
|
464
|
+
at: "at";
|
|
465
|
+
comma: "comma";
|
|
466
|
+
in: "in";
|
|
467
|
+
near: "near";
|
|
468
|
+
to: "to";
|
|
469
|
+
}>>;
|
|
470
|
+
anchor: z.ZodNullable<z.ZodObject<{
|
|
471
|
+
text: z.ZodNullable<z.ZodString>;
|
|
472
|
+
tree: z.ZodNullable<z.ZodCustom<AddressTree, AddressTree>>;
|
|
473
|
+
biasPoint: z.ZodNullable<z.ZodObject<{
|
|
474
|
+
latitude: z.ZodNumber;
|
|
475
|
+
longitude: z.ZodNumber;
|
|
476
|
+
}, z.core.$strip>>;
|
|
477
|
+
radiusM: z.ZodNullable<z.ZodNumber>;
|
|
478
|
+
}, z.core.$strip>>;
|
|
479
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
480
|
+
}, z.core.$strip>;
|
|
481
|
+
export type POIIntent = z.infer<typeof POIIntentSchema>;
|
|
311
482
|
/**
|
|
312
483
|
* One POI search result.
|
|
313
484
|
*/
|
|
314
|
-
export
|
|
315
|
-
name:
|
|
316
|
-
categoryID:
|
|
317
|
-
brandWikidata:
|
|
318
|
-
latitude:
|
|
319
|
-
longitude:
|
|
320
|
-
country:
|
|
321
|
-
confidence:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
485
|
+
export declare const POIResultSchema: z.ZodObject<{
|
|
486
|
+
name: z.ZodNullable<z.ZodString>;
|
|
487
|
+
categoryID: z.ZodNullable<z.ZodString>;
|
|
488
|
+
brandWikidata: z.ZodNullable<z.ZodString>;
|
|
489
|
+
latitude: z.ZodNumber;
|
|
490
|
+
longitude: z.ZodNumber;
|
|
491
|
+
country: z.ZodString;
|
|
492
|
+
confidence: z.ZodNumber;
|
|
493
|
+
gersID: z.ZodNullable<z.ZodString>;
|
|
494
|
+
ancestry: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
495
|
+
placetype: z.ZodString;
|
|
496
|
+
name: z.ZodString;
|
|
497
|
+
wofID: z.ZodNumber;
|
|
498
|
+
}, z.core.$strip>>>>;
|
|
499
|
+
distanceM: z.ZodNullable<z.ZodNumber>;
|
|
500
|
+
}, z.core.$strip>;
|
|
501
|
+
export type POIResult = z.infer<typeof POIResultSchema>;
|
|
502
|
+
/**
|
|
503
|
+
* The result of POI handling: an intent with optional results, or an abstention with a reason.
|
|
504
|
+
*/
|
|
505
|
+
export declare const POIQueryResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
506
|
+
type: z.ZodLiteral<"intent">;
|
|
507
|
+
intent: z.ZodObject<{
|
|
508
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
509
|
+
kind: z.ZodLiteral<"category">;
|
|
510
|
+
categoryIDs: z.ZodArray<z.ZodString>;
|
|
511
|
+
matched: z.ZodString;
|
|
512
|
+
countryBinding: z.ZodNullable<z.ZodObject<{
|
|
513
|
+
anchorCountry: z.ZodNullable<z.ZodString>;
|
|
514
|
+
excludedCategoryIDs: z.ZodArray<z.ZodString>;
|
|
515
|
+
}, z.core.$strip>>;
|
|
516
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
517
|
+
kind: z.ZodLiteral<"brand">;
|
|
518
|
+
name: z.ZodString;
|
|
519
|
+
wikidata: z.ZodNullable<z.ZodString>;
|
|
520
|
+
matched: z.ZodString;
|
|
521
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
522
|
+
kind: z.ZodLiteral<"name">;
|
|
523
|
+
text: z.ZodString;
|
|
524
|
+
}, z.core.$strip>], "kind">;
|
|
525
|
+
relation: z.ZodNullable<z.ZodEnum<{
|
|
526
|
+
around: "around";
|
|
527
|
+
at: "at";
|
|
528
|
+
comma: "comma";
|
|
529
|
+
in: "in";
|
|
530
|
+
near: "near";
|
|
531
|
+
to: "to";
|
|
532
|
+
}>>;
|
|
533
|
+
anchor: z.ZodNullable<z.ZodObject<{
|
|
534
|
+
text: z.ZodNullable<z.ZodString>;
|
|
535
|
+
tree: z.ZodNullable<z.ZodCustom<AddressTree, AddressTree>>;
|
|
536
|
+
biasPoint: z.ZodNullable<z.ZodObject<{
|
|
537
|
+
latitude: z.ZodNumber;
|
|
538
|
+
longitude: z.ZodNumber;
|
|
539
|
+
}, z.core.$strip>>;
|
|
540
|
+
radiusM: z.ZodNullable<z.ZodNumber>;
|
|
541
|
+
}, z.core.$strip>>;
|
|
542
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
543
|
+
}, z.core.$strip>;
|
|
544
|
+
results: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
545
|
+
name: z.ZodNullable<z.ZodString>;
|
|
546
|
+
categoryID: z.ZodNullable<z.ZodString>;
|
|
547
|
+
brandWikidata: z.ZodNullable<z.ZodString>;
|
|
548
|
+
latitude: z.ZodNumber;
|
|
549
|
+
longitude: z.ZodNumber;
|
|
550
|
+
country: z.ZodString;
|
|
551
|
+
confidence: z.ZodNumber;
|
|
552
|
+
gersID: z.ZodNullable<z.ZodString>;
|
|
553
|
+
ancestry: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
554
|
+
placetype: z.ZodString;
|
|
555
|
+
name: z.ZodString;
|
|
556
|
+
wofID: z.ZodNumber;
|
|
557
|
+
}, z.core.$strip>>>>;
|
|
558
|
+
distanceM: z.ZodNullable<z.ZodNumber>;
|
|
559
|
+
}, z.core.$strip>>>;
|
|
560
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
561
|
+
type: z.ZodLiteral<"abstain">;
|
|
562
|
+
reason: z.ZodString;
|
|
563
|
+
}, z.core.$strip>], "type">;
|
|
564
|
+
export type POIQueryResult = z.infer<typeof POIQueryResultSchema>;
|
|
348
565
|
/**
|
|
349
566
|
* Structural phrase shapes that the phrase grouper proposes before classification.
|
|
350
567
|
*/
|
|
@@ -390,9 +607,13 @@ export interface FSTMatcherLike {
|
|
|
390
607
|
* Options for {@link AddressClassifier.parse}.
|
|
391
608
|
*/
|
|
392
609
|
export interface ClassifierOpts {
|
|
393
|
-
|
|
610
|
+
/**
|
|
611
|
+
* The pipeline's query shape.
|
|
612
|
+
* Classifiers read its format hits.
|
|
613
|
+
*/
|
|
614
|
+
queryShape?: Pick<QueryShapeLite, "knownFormats">;
|
|
394
615
|
inputMode?: InputMode;
|
|
395
|
-
fst?: FSTMatcherLike;
|
|
616
|
+
fst?: FSTMatcherLike | null;
|
|
396
617
|
fstBiasScale?: number;
|
|
397
618
|
/**
|
|
398
619
|
* The street-morphology matcher for the street-context check.
|
|
@@ -411,19 +632,16 @@ export interface ClassifierOpts {
|
|
|
411
632
|
*/
|
|
412
633
|
postcodeRepair?: boolean;
|
|
413
634
|
/**
|
|
414
|
-
*
|
|
415
|
-
*
|
|
635
|
+
* How the classifier treats letter case.
|
|
636
|
+
*
|
|
637
|
+
* @defaultValue {@linkcode DEFAULT_CASE_NORMALIZATION}
|
|
416
638
|
*/
|
|
417
|
-
|
|
639
|
+
caseNormalization?: CaseNormalization;
|
|
418
640
|
/**
|
|
419
641
|
* Reconciles differing BIO tags among the pieces of one word.
|
|
420
642
|
*/
|
|
421
|
-
enforceWordConsistency?:
|
|
422
|
-
|
|
423
|
-
skipByteFallbackWords?: boolean;
|
|
424
|
-
splitOnPunctuation?: boolean;
|
|
425
|
-
};
|
|
426
|
-
placetypePair?: PlacetypePairPassthrough;
|
|
643
|
+
enforceWordConsistency?: WordConsistencySetting;
|
|
644
|
+
placetypePair?: PlacetypePairSelection;
|
|
427
645
|
}
|
|
428
646
|
/**
|
|
429
647
|
* The word-consistency settings that the runtime and evaluation paths both use.
|
|
@@ -450,7 +668,8 @@ export type LocaleDetector = (input: NormalizedInputLite, shape: QueryShapeLite,
|
|
|
450
668
|
}) => Promise<LocaleHint>;
|
|
451
669
|
/**
|
|
452
670
|
* The stage implementations that the runtime pipeline composes.
|
|
453
|
-
*
|
|
671
|
+
*
|
|
672
|
+
* Every stage is optional, and a missing stage is skipped or replaced by its built-in default.
|
|
454
673
|
*/
|
|
455
674
|
export interface RuntimePipelineStages {
|
|
456
675
|
normalize?: (raw: string, opts?: {
|
|
@@ -478,7 +697,7 @@ export interface RuntimePipelineStages {
|
|
|
478
697
|
* The POI handler.
|
|
479
698
|
* A `null` result falls through to the full parse.
|
|
480
699
|
*/
|
|
481
|
-
poiIntent?: (input: NormalizedInputLite, locale: LocaleHint, opts?: PipelineOpts) => Promise<
|
|
700
|
+
poiIntent?: (input: NormalizedInputLite, locale: LocaleHint, opts?: PipelineOpts) => Promise<POIQueryResult | null>;
|
|
482
701
|
/**
|
|
483
702
|
* The phrase grouper.
|
|
484
703
|
*
|