@mailwoman/core 11.1.0 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/api/arcgis.ts +194 -0
- package/lib/api/ckan.ts +1 -1
- package/lib/api/disk-storage.ts +2 -2
- package/lib/api/ogc.ts +1 -1
- package/lib/api/retry.ts +7 -2
- package/lib/api/test/transport.ts +1 -1
- package/lib/{binary-frame.ts → asset/binary-frame.ts} +1 -1
- package/lib/async/abort.ts +100 -0
- package/lib/{memoize.ts → async/memoize.ts} +2 -2
- package/lib/{promises.ts → async/promises.ts} +1 -1
- package/lib/cloudflare/tokens.ts +1 -1
- package/lib/cloudflare/wrangler.ts +3 -3
- package/lib/crypto/digest.ts +1 -1
- package/lib/crypto/ed25519.ts +8 -0
- package/lib/crypto/node.ts +1 -1
- package/lib/data-root.ts +16 -3
- package/lib/decoder/containment.ts +4 -1
- package/lib/decoder/serialize/outline.ts +50 -0
- package/lib/decoder/types.ts +9 -1
- package/lib/decoder.ts +1 -0
- package/lib/env/schema.ts +5 -0
- package/lib/fs/deflate64.ts +1 -1
- package/lib/fs/lock.ts +183 -25
- package/lib/fs/readers.ts +1 -1
- package/lib/fs/writers.ts +1 -1
- package/lib/geocode/result.ts +50 -6
- package/lib/html/text.ts +2 -2
- package/lib/index.ts +0 -1
- package/lib/layers/artifact.ts +2 -2
- package/lib/layers/coverage.ts +1 -1
- package/lib/layers/manifest.ts +94 -2
- package/lib/layers/provenance.ts +246 -0
- package/lib/layers/publication.ts +4 -3
- package/lib/layers/selection.ts +2 -2
- package/lib/license/branch.ts +66 -0
- package/lib/license/configured.ts +4 -2
- package/lib/license/declaration.ts +1 -1
- package/lib/license/key/file.ts +1 -1
- package/lib/license/key.ts +148 -201
- package/lib/license/provenance.ts +193 -0
- package/lib/license/register.ts +7 -78
- package/lib/license/stamp.ts +8 -2
- package/lib/license/text-url.ts +55 -0
- package/lib/license/training.ts +67 -0
- package/lib/license.ts +7 -6
- package/lib/locale/registry.ts +1 -1
- package/lib/locale/zh-cn-units.ts +1 -1
- package/lib/module/workspace.ts +1 -1
- package/lib/{routing.ts → network/routing.ts} +1 -1
- package/lib/pipeline/result.ts +7 -27
- package/lib/pipeline/runtime-pipeline.ts +131 -152
- package/lib/pipeline/stage.ts +290 -0
- package/lib/pipeline/types.ts +154 -20
- package/lib/pipeline.ts +14 -2
- package/lib/{git.ts → repo/git.ts} +21 -1
- package/lib/{release-config.ts → repo/release-config.ts} +8 -0
- package/lib/{scope-config.ts → repo/scope-config.ts} +8 -36
- package/lib/{spdx-header.ts → repo/spdx-header.ts} +8 -0
- package/lib/{workspaces.ts → repo/workspaces.ts} +1 -1
- package/lib/resolver/lookup-types.ts +1 -1
- package/lib/resolver/region-database-provider.ts +33 -0
- package/lib/resolver/synthetic-id-ranges.ts +76 -4
- package/lib/resolver/types.ts +231 -6
- package/lib/resolver.ts +14 -1
- package/lib/state-machine.ts +1 -1
- package/lib/strings/python-json.ts +15 -5
- package/lib/tokenization/Span.ts +12 -0
- package/lib/utils/chunk-process.ts +2 -2
- package/lib/utils/geodatabase-archive.ts +1 -1
- package/lib/utils/time.ts +190 -6
- package/lib/utils.ts +4 -4
- package/out/api/arcgis.d.ts +76 -0
- package/out/api/arcgis.d.ts.map +1 -1
- package/out/api/arcgis.js +123 -0
- package/out/api/arcgis.js.map +1 -1
- package/out/api/ckan.js +1 -1
- package/out/api/ckan.js.map +1 -1
- package/out/api/disk-storage.d.ts.map +1 -1
- package/out/api/disk-storage.js +2 -2
- package/out/api/disk-storage.js.map +1 -1
- package/out/api/ogc.js +1 -1
- package/out/api/ogc.js.map +1 -1
- package/out/api/retry.d.ts.map +1 -1
- package/out/api/retry.js +6 -2
- package/out/api/retry.js.map +1 -1
- package/out/api/test/transport.js +1 -1
- package/out/api/test/transport.js.map +1 -1
- package/out/asset/binary-frame.d.ts.map +1 -0
- package/out/{binary-frame.js → asset/binary-frame.js} +1 -1
- package/out/asset/binary-frame.js.map +1 -0
- package/out/asset/load-ledger.d.ts.map +1 -0
- package/out/asset/load-ledger.js.map +1 -0
- package/out/asset/overture-pins.d.ts.map +1 -0
- package/out/asset/overture-pins.js.map +1 -0
- package/out/asset/postcode-prefix-files.d.ts.map +1 -0
- package/out/asset/postcode-prefix-files.js.map +1 -0
- package/out/async/abort.d.ts +57 -0
- package/out/async/abort.d.ts.map +1 -0
- package/out/async/abort.js +89 -0
- package/out/async/abort.js.map +1 -0
- package/out/async/memoize.d.ts.map +1 -0
- package/out/{memoize.js → async/memoize.js} +2 -2
- package/out/async/memoize.js.map +1 -0
- package/out/{promises.d.ts → async/promises.d.ts} +1 -1
- package/out/async/promises.d.ts.map +1 -0
- package/out/{promises.js → async/promises.js} +1 -1
- package/out/async/promises.js.map +1 -0
- package/out/cloudflare/tokens.js +1 -1
- package/out/cloudflare/tokens.js.map +1 -1
- package/out/cloudflare/wrangler.js +3 -3
- package/out/cloudflare/wrangler.js.map +1 -1
- package/out/crypto/digest.d.ts +1 -1
- package/out/crypto/digest.js +1 -1
- package/out/crypto/ed25519.d.ts +7 -0
- package/out/crypto/ed25519.d.ts.map +1 -1
- package/out/crypto/ed25519.js +7 -0
- package/out/crypto/ed25519.js.map +1 -1
- package/out/crypto/hash.d.ts.map +1 -0
- package/out/crypto/hash.js.map +1 -0
- package/out/crypto/node.js +1 -1
- package/out/crypto/node.js.map +1 -1
- package/out/data-root.d.ts +11 -3
- package/out/data-root.d.ts.map +1 -1
- package/out/data-root.js +14 -3
- package/out/data-root.js.map +1 -1
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js +1 -1
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/serialize/outline.d.ts +25 -0
- package/out/decoder/serialize/outline.d.ts.map +1 -0
- package/out/decoder/serialize/outline.js +37 -0
- package/out/decoder/serialize/outline.js.map +1 -0
- package/out/decoder/types.d.ts +8 -0
- 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.d.ts +1 -0
- package/out/decoder.d.ts.map +1 -1
- package/out/decoder.js +1 -0
- package/out/decoder.js.map +1 -1
- package/out/env/schema.d.ts +1 -0
- package/out/env/schema.d.ts.map +1 -1
- package/out/env/schema.js +4 -0
- package/out/env/schema.js.map +1 -1
- package/out/env.d.ts +1 -0
- package/out/env.d.ts.map +1 -1
- package/out/fs/deflate64.js +1 -1
- package/out/fs/deflate64.js.map +1 -1
- package/out/fs/lock.d.ts +73 -4
- package/out/fs/lock.d.ts.map +1 -1
- package/out/fs/lock.js +96 -19
- package/out/fs/lock.js.map +1 -1
- package/out/fs/readers.js +1 -1
- package/out/fs/readers.js.map +1 -1
- package/out/fs/writers.d.ts +1 -1
- package/out/fs/writers.d.ts.map +1 -1
- package/out/fs/writers.js +1 -1
- package/out/fs/writers.js.map +1 -1
- package/out/geocode/result.d.ts +25 -1
- package/out/geocode/result.d.ts.map +1 -1
- package/out/geocode/result.js +49 -6
- package/out/geocode/result.js.map +1 -1
- package/out/html/text.js +2 -2
- package/out/html/trust-policies.d.ts.map +1 -0
- package/out/html/trust-policies.js.map +1 -0
- package/out/index.d.ts +0 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +0 -1
- package/out/index.js.map +1 -1
- package/out/layers/artifact.js +2 -2
- package/out/layers/artifact.js.map +1 -1
- package/out/layers/coverage.d.ts.map +1 -1
- package/out/layers/coverage.js +1 -1
- package/out/layers/coverage.js.map +1 -1
- package/out/layers/manifest.d.ts +53 -0
- package/out/layers/manifest.d.ts.map +1 -1
- package/out/layers/manifest.js +68 -2
- package/out/layers/manifest.js.map +1 -1
- package/out/layers/provenance.d.ts +127 -0
- package/out/layers/provenance.d.ts.map +1 -0
- package/out/layers/provenance.js +122 -0
- package/out/layers/provenance.js.map +1 -0
- package/out/layers/publication.d.ts.map +1 -1
- package/out/layers/publication.js +3 -3
- package/out/layers/publication.js.map +1 -1
- package/out/layers/selection.d.ts.map +1 -1
- package/out/layers/selection.js +2 -2
- package/out/layers/selection.js.map +1 -1
- package/out/license/branch.d.ts +33 -0
- package/out/license/branch.d.ts.map +1 -0
- package/out/license/branch.js +52 -0
- package/out/license/branch.js.map +1 -0
- package/out/license/configured.d.ts +1 -1
- package/out/license/configured.d.ts.map +1 -1
- package/out/license/configured.js +1 -9
- package/out/license/configured.js.map +1 -1
- package/out/license/declaration.d.ts +1 -1
- package/out/license/declaration.d.ts.map +1 -1
- package/out/license/key/file.js +1 -1
- package/out/license/key/file.js.map +1 -1
- package/out/license/key.d.ts +27 -115
- package/out/license/key.d.ts.map +1 -1
- package/out/license/key.js +98 -164
- package/out/license/key.js.map +1 -1
- package/out/license/provenance.d.ts +47 -0
- package/out/license/provenance.d.ts.map +1 -0
- package/out/license/provenance.js +134 -0
- package/out/license/provenance.js.map +1 -0
- package/out/license/register.d.ts +6 -47
- package/out/license/register.d.ts.map +1 -1
- package/out/license/register.js +7 -58
- package/out/license/register.js.map +1 -1
- package/out/license/stamp.d.ts +7 -1
- 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/license/text-url.d.ts +9 -0
- package/out/license/text-url.d.ts.map +1 -0
- package/out/license/text-url.js +49 -0
- package/out/license/text-url.js.map +1 -0
- package/out/license/training.d.ts +29 -0
- package/out/license/training.d.ts.map +1 -0
- package/out/license/training.js +52 -0
- package/out/license/training.js.map +1 -0
- package/out/license.d.ts +7 -6
- package/out/license.d.ts.map +1 -1
- package/out/license.js +7 -6
- package/out/license.js.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.js +1 -1
- package/out/locale/zh-cn-units.js.map +1 -1
- package/out/math/numeric.d.ts.map +1 -0
- package/out/math/numeric.js.map +1 -0
- package/out/math/random.d.ts.map +1 -0
- package/out/math/random.js.map +1 -0
- package/out/math/stats.d.ts.map +1 -0
- package/out/math/stats.js.map +1 -0
- package/out/module/workspace.js +1 -1
- package/out/module/workspace.js.map +1 -1
- package/out/network/routing.d.ts.map +1 -0
- package/out/{routing.js → network/routing.js} +1 -1
- package/out/network/routing.js.map +1 -0
- package/out/pipeline/result.d.ts +7 -25
- package/out/pipeline/result.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +8 -4
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +56 -109
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/stage.d.ts +180 -0
- package/out/pipeline/stage.d.ts.map +1 -0
- package/out/pipeline/stage.js +130 -0
- package/out/pipeline/stage.js.map +1 -0
- package/out/pipeline/types.d.ts +146 -20
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +24 -8
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline.d.ts +5 -3
- package/out/pipeline.d.ts.map +1 -1
- package/out/pipeline.js +2 -1
- package/out/pipeline.js.map +1 -1
- package/out/{git.d.ts → repo/git.d.ts} +10 -1
- package/out/repo/git.d.ts.map +1 -0
- package/out/{git.js → repo/git.js} +14 -1
- package/out/repo/git.js.map +1 -0
- package/out/{release-config.d.ts → repo/release-config.d.ts} +8 -0
- package/out/repo/release-config.d.ts.map +1 -0
- package/out/repo/release-config.js.map +1 -0
- package/out/{scope-config.d.ts → repo/scope-config.d.ts} +8 -23
- package/out/repo/scope-config.d.ts.map +1 -0
- package/out/{scope-config.js → repo/scope-config.js} +0 -17
- package/out/repo/scope-config.js.map +1 -0
- package/out/repo/spdx-header.d.ts.map +1 -0
- package/out/{spdx-header.js → repo/spdx-header.js} +7 -0
- package/out/repo/spdx-header.js.map +1 -0
- package/out/repo/vale.d.ts.map +1 -0
- package/out/repo/vale.js.map +1 -0
- package/out/repo/workspaces.d.ts.map +1 -0
- package/out/{workspaces.js → repo/workspaces.js} +1 -1
- package/out/repo/workspaces.js.map +1 -0
- package/out/resolver/lookup-types.d.ts +1 -1
- package/out/resolver/region-database-provider.d.ts +30 -0
- package/out/resolver/region-database-provider.d.ts.map +1 -1
- package/out/resolver/synthetic-id-ranges.d.ts +46 -4
- package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
- package/out/resolver/synthetic-id-ranges.js +66 -4
- package/out/resolver/synthetic-id-ranges.js.map +1 -1
- package/out/resolver/types.d.ts +201 -7
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +57 -0
- package/out/resolver/types.js.map +1 -1
- package/out/resolver.d.ts +3 -3
- package/out/resolver.d.ts.map +1 -1
- package/out/resolver.js +1 -1
- package/out/resolver.js.map +1 -1
- package/out/scripting/process.d.ts.map +1 -0
- package/out/scripting/process.js.map +1 -0
- package/out/scripting/workers.d.ts.map +1 -0
- package/out/scripting/workers.js.map +1 -0
- package/out/state-machine.d.ts +1 -1
- package/out/strings/python-json.d.ts +12 -1
- package/out/strings/python-json.d.ts.map +1 -1
- package/out/strings/python-json.js +9 -4
- package/out/strings/python-json.js.map +1 -1
- package/out/tokenization/Span.d.ts +11 -0
- package/out/tokenization/Span.d.ts.map +1 -1
- package/out/tokenization/Span.js.map +1 -1
- package/out/tools/build-deflate64-wasm.run.js +2 -2
- package/out/tools/build-deflate64-wasm.run.js.map +1 -1
- package/out/tools/coarse-placer/build/dataset.js +1 -1
- package/out/tools/coarse-placer/build/dataset.js.map +1 -1
- package/out/tools/coarse-placer/build/outlier/exposure.js +1 -1
- package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
- package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -1
- package/out/tools/coarse-placer/build/outlier/latin.js +5 -1
- package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -1
- package/out/tools/coarse-placer/country-sets.d.ts +2 -2
- package/out/tools/coarse-placer/country-sets.js +2 -2
- package/out/tools/coarse-placer/outlier-rows.js +2 -2
- package/out/tools/coarse-placer/outlier-rows.js.map +1 -1
- package/out/tools/coarse-placer/train.js +1 -1
- package/out/tools/coarse-placer/train.js.map +1 -1
- package/out/tools/generate-language-types.js +2 -2
- package/out/tools/generate-language-types.js.map +1 -1
- package/out/tools/license/product-fixtures.run.d.ts +2 -0
- package/out/tools/license/product-fixtures.run.d.ts.map +1 -0
- package/out/tools/license/product-fixtures.run.js +350 -0
- package/out/tools/license/product-fixtures.run.js.map +1 -0
- package/out/utils/chunk-process.js +2 -2
- package/out/utils/chunk-process.js.map +1 -1
- package/out/utils/geodatabase-archive.js +1 -1
- package/out/utils/geodatabase-archive.js.map +1 -1
- package/out/utils/time.d.ts +46 -3
- package/out/utils/time.d.ts.map +1 -1
- package/out/utils/time.js +139 -6
- package/out/utils/time.js.map +1 -1
- package/out/utils.d.ts +4 -4
- package/out/utils.d.ts.map +1 -1
- package/out/utils.js +4 -4
- package/out/utils.js.map +1 -1
- package/out/values/identical.d.ts.map +1 -0
- package/out/values/identical.js.map +1 -0
- package/out/values/json.d.ts.map +1 -0
- package/out/values/json.js.map +1 -0
- package/out/values/objects.d.ts.map +1 -0
- package/out/values/objects.js.map +1 -0
- package/package.json +278 -243
- package/tools/build-deflate64-wasm.run.ts +2 -2
- package/tools/coarse-placer/build/dataset.ts +1 -1
- package/tools/coarse-placer/build/outlier/exposure.ts +1 -1
- package/tools/coarse-placer/build/outlier/latin.ts +5 -1
- package/tools/coarse-placer/country-sets.ts +2 -2
- package/tools/coarse-placer/outlier-rows.ts +2 -2
- package/tools/coarse-placer/train.ts +1 -1
- package/tools/generate-language-types.ts +2 -2
- package/tools/license/product-fixtures.run.ts +449 -0
- package/lib/collections.ts +0 -5
- package/lib/license/decision.ts +0 -329
- package/lib/license/obligations.ts +0 -256
- package/lib/license/record.ts +0 -277
- package/lib/scripting/ingest-chunk-script.ts +0 -87
- package/out/binary-frame.d.ts.map +0 -1
- package/out/binary-frame.js.map +0 -1
- package/out/collections.d.ts +0 -2
- package/out/collections.d.ts.map +0 -1
- package/out/collections.js +0 -5
- package/out/collections.js.map +0 -1
- package/out/git.d.ts.map +0 -1
- package/out/git.js.map +0 -1
- package/out/hash.d.ts.map +0 -1
- package/out/hash.js.map +0 -1
- package/out/identical.d.ts.map +0 -1
- package/out/identical.js.map +0 -1
- package/out/json.d.ts.map +0 -1
- package/out/json.js.map +0 -1
- package/out/license/decision.d.ts +0 -179
- package/out/license/decision.d.ts.map +0 -1
- package/out/license/decision.js +0 -169
- package/out/license/decision.js.map +0 -1
- package/out/license/obligations.d.ts +0 -102
- package/out/license/obligations.d.ts.map +0 -1
- package/out/license/obligations.js +0 -188
- package/out/license/obligations.js.map +0 -1
- package/out/license/record.d.ts +0 -136
- package/out/license/record.d.ts.map +0 -1
- package/out/license/record.js +0 -222
- package/out/license/record.js.map +0 -1
- package/out/load-ledger.d.ts.map +0 -1
- package/out/load-ledger.js.map +0 -1
- package/out/memoize.d.ts.map +0 -1
- package/out/memoize.js.map +0 -1
- package/out/numeric.d.ts.map +0 -1
- package/out/numeric.js.map +0 -1
- package/out/objects.d.ts.map +0 -1
- package/out/objects.js.map +0 -1
- package/out/overture-pins.d.ts.map +0 -1
- package/out/overture-pins.js.map +0 -1
- package/out/postcode-prefix-files.d.ts.map +0 -1
- package/out/postcode-prefix-files.js.map +0 -1
- package/out/process.d.ts.map +0 -1
- package/out/process.js.map +0 -1
- package/out/promises.d.ts.map +0 -1
- package/out/promises.js.map +0 -1
- package/out/random.d.ts.map +0 -1
- package/out/random.js.map +0 -1
- package/out/release-config.d.ts.map +0 -1
- package/out/release-config.js.map +0 -1
- package/out/routing.d.ts.map +0 -1
- package/out/routing.js.map +0 -1
- package/out/scope-config.d.ts.map +0 -1
- package/out/scope-config.js.map +0 -1
- package/out/scripting/ingest-chunk-script.d.ts +0 -58
- package/out/scripting/ingest-chunk-script.d.ts.map +0 -1
- package/out/scripting/ingest-chunk-script.js +0 -47
- package/out/scripting/ingest-chunk-script.js.map +0 -1
- package/out/spdx-header.d.ts.map +0 -1
- package/out/spdx-header.js.map +0 -1
- package/out/stats.d.ts.map +0 -1
- package/out/stats.js.map +0 -1
- package/out/trust-policies.d.ts.map +0 -1
- package/out/trust-policies.js.map +0 -1
- package/out/vale.d.ts.map +0 -1
- package/out/vale.js.map +0 -1
- package/out/workers.d.ts.map +0 -1
- package/out/workers.js.map +0 -1
- package/out/workspaces.d.ts.map +0 -1
- package/out/workspaces.js.map +0 -1
- /package/lib/{load-ledger.ts → asset/load-ledger.ts} +0 -0
- /package/lib/{overture-pins.ts → asset/overture-pins.ts} +0 -0
- /package/lib/{postcode-prefix-files.ts → asset/postcode-prefix-files.ts} +0 -0
- /package/lib/{hash.ts → crypto/hash.ts} +0 -0
- /package/lib/{trust-policies.ts → html/trust-policies.ts} +0 -0
- /package/lib/{numeric.ts → math/numeric.ts} +0 -0
- /package/lib/{random.ts → math/random.ts} +0 -0
- /package/lib/{stats.ts → math/stats.ts} +0 -0
- /package/lib/{vale.ts → repo/vale.ts} +0 -0
- /package/lib/{process.ts → scripting/process.ts} +0 -0
- /package/lib/{workers.ts → scripting/workers.ts} +0 -0
- /package/lib/{identical.ts → values/identical.ts} +0 -0
- /package/lib/{json.ts → values/json.ts} +0 -0
- /package/lib/{objects.ts → values/objects.ts} +0 -0
- /package/out/{binary-frame.d.ts → asset/binary-frame.d.ts} +0 -0
- /package/out/{load-ledger.d.ts → asset/load-ledger.d.ts} +0 -0
- /package/out/{load-ledger.js → asset/load-ledger.js} +0 -0
- /package/out/{overture-pins.d.ts → asset/overture-pins.d.ts} +0 -0
- /package/out/{overture-pins.js → asset/overture-pins.js} +0 -0
- /package/out/{postcode-prefix-files.d.ts → asset/postcode-prefix-files.d.ts} +0 -0
- /package/out/{postcode-prefix-files.js → asset/postcode-prefix-files.js} +0 -0
- /package/out/{memoize.d.ts → async/memoize.d.ts} +0 -0
- /package/out/{hash.d.ts → crypto/hash.d.ts} +0 -0
- /package/out/{hash.js → crypto/hash.js} +0 -0
- /package/out/{trust-policies.d.ts → html/trust-policies.d.ts} +0 -0
- /package/out/{trust-policies.js → html/trust-policies.js} +0 -0
- /package/out/{numeric.d.ts → math/numeric.d.ts} +0 -0
- /package/out/{numeric.js → math/numeric.js} +0 -0
- /package/out/{random.d.ts → math/random.d.ts} +0 -0
- /package/out/{random.js → math/random.js} +0 -0
- /package/out/{stats.d.ts → math/stats.d.ts} +0 -0
- /package/out/{stats.js → math/stats.js} +0 -0
- /package/out/{routing.d.ts → network/routing.d.ts} +0 -0
- /package/out/{release-config.js → repo/release-config.js} +0 -0
- /package/out/{spdx-header.d.ts → repo/spdx-header.d.ts} +0 -0
- /package/out/{vale.d.ts → repo/vale.d.ts} +0 -0
- /package/out/{vale.js → repo/vale.js} +0 -0
- /package/out/{workspaces.d.ts → repo/workspaces.d.ts} +0 -0
- /package/out/{process.d.ts → scripting/process.d.ts} +0 -0
- /package/out/{process.js → scripting/process.js} +0 -0
- /package/out/{workers.d.ts → scripting/workers.d.ts} +0 -0
- /package/out/{workers.js → scripting/workers.js} +0 -0
- /package/out/{identical.d.ts → values/identical.d.ts} +0 -0
- /package/out/{identical.js → values/identical.js} +0 -0
- /package/out/{json.d.ts → values/json.d.ts} +0 -0
- /package/out/{json.js → values/json.js} +0 -0
- /package/out/{objects.d.ts → values/objects.d.ts} +0 -0
- /package/out/{objects.js → values/objects.js} +0 -0
|
@@ -76,6 +76,11 @@ export const SPDX_HEADER_EXEMPT_PATHS: readonly string[] = [
|
|
|
76
76
|
"packages/sentencepiece-wasm/sentencepiece.mjs",
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Matches a `*.snippet.*` file under `docs/`, which a page includes as a reader's script.
|
|
81
|
+
*/
|
|
82
|
+
const DOCS_SNIPPET_PATH = /^docs\/.+\.snippet\.(?:ts|mts|tsx)$/
|
|
83
|
+
|
|
79
84
|
/**
|
|
80
85
|
* The header syntax for a repository-relative path, or null when the path takes no header.
|
|
81
86
|
*/
|
|
@@ -84,6 +89,9 @@ export function sourceHeaderSyntax(path: string): SourceHeaderSyntax | null {
|
|
|
84
89
|
return null
|
|
85
90
|
}
|
|
86
91
|
|
|
92
|
+
// A docs page prints the whole text of a snippet file to its reader.
|
|
93
|
+
if (DOCS_SNIPPET_PATH.test(path)) return null
|
|
94
|
+
|
|
87
95
|
if (path.endsWith(".d.ts")) return SourceHeaderSyntax.Slash
|
|
88
96
|
|
|
89
97
|
const extension = /\.([a-z]+)$/.exec(path)?.[1]
|
|
@@ -14,8 +14,8 @@ import { type PathBuilderLike, resolvePath } from "path-ts"
|
|
|
14
14
|
import { Globerator } from "spliterator/node/fs"
|
|
15
15
|
|
|
16
16
|
import { tryStat } from "#fs/readers/stat"
|
|
17
|
-
import { stringifyJSON } from "#json"
|
|
18
17
|
import { readPackageJSON } from "#module/resolve-from"
|
|
18
|
+
import { stringifyJSON } from "#values/json"
|
|
19
19
|
|
|
20
20
|
const TRAILING_STAR = /^(?<parent>[^*]+)\/\*$/u
|
|
21
21
|
|
|
@@ -87,7 +87,7 @@ export interface AddressPointLookup {
|
|
|
87
87
|
* One interpolated coordinate estimate, never an exact situs point.
|
|
88
88
|
* `uncertaintyM` states the estimate's radius in meters.
|
|
89
89
|
*
|
|
90
|
-
* A structural mirror of `InterpolatedHit` in `resolver-wof-sqlite/interpolation.ts`.
|
|
90
|
+
* A structural mirror of `InterpolatedHit` in `resolver-wof-sqlite/labels/street/interpolation.ts`.
|
|
91
91
|
* Keep this a subset of that shape so the concrete `StreetInterpolator`
|
|
92
92
|
* and `AddressPointInterpolator` satisfy {@link InterpolationLookup} with no adapter,
|
|
93
93
|
* following the {@link AddressPointHit} precedent.
|
|
@@ -54,4 +54,37 @@ export interface RegionDatabaseProvider<
|
|
|
54
54
|
* A region with no database on disk yields a bundle with no members.
|
|
55
55
|
*/
|
|
56
56
|
for(key: TKey): TDatabases
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The database files `for(key)` reads, one per tier, and where a user obtains
|
|
60
|
+
* the sources their manifests record.
|
|
61
|
+
*
|
|
62
|
+
* A caller reads each file's `layer_manifest` to state the region's terms and sources.
|
|
63
|
+
* A region with no database on disk yields an empty array.
|
|
64
|
+
*/
|
|
65
|
+
layerDatabases?(key: TKey): readonly RegionLayerDatabase[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Where a user obtains one data source: a page that explains how, or lists its downloads.
|
|
70
|
+
*/
|
|
71
|
+
export interface SourceLocation {
|
|
72
|
+
/**
|
|
73
|
+
* The source's name for a reader, such as `Base Adresse Nationale`.
|
|
74
|
+
*/
|
|
75
|
+
title: string
|
|
76
|
+
url: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* One database file a region provider reads for a region.
|
|
81
|
+
*/
|
|
82
|
+
export interface RegionLayerDatabase {
|
|
83
|
+
tier: keyof RegionDatabases
|
|
84
|
+
path: string
|
|
85
|
+
/**
|
|
86
|
+
* Where a user obtains each source the provider's layers record, keyed by the source's
|
|
87
|
+
* name in a manifest's `source`: the part before any `:` scope, such as `ban` in `ban:fr`.
|
|
88
|
+
*/
|
|
89
|
+
sourceLocations: Readonly<Record<string, SourceLocation>>
|
|
57
90
|
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @file The one registry of synthetic place-id ranges.
|
|
5
|
+
* @file The one registry of synthetic place-id ranges, and of the range `mailwoman` mints WOF records from.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* An upstream WOF id is below 2e9, and a WOF record minted in a `mailwoman` fork takes an id from
|
|
8
|
+
* {@link MAILWOMAN_WOF_ID_BASE}. Every other source whose places a gazetteer artifact adds mints ids from a higher base.
|
|
8
9
|
* The bases must be pairwise distinct. The candidate table's `candidate_ancestor` and
|
|
9
10
|
* `candidate_interval` sidecars are keyed only by `spr_id`, a result's `placeID` is `wof:<spr_id>`, and the
|
|
10
11
|
* backend's `ancestors(id)` answers whichever row wrote last. Two builders that pick the same base give two places
|
|
@@ -17,22 +18,93 @@
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* The first id of the WOF records minted in the `mailwoman` forks, `989 5xx xxxx`.
|
|
22
|
+
*
|
|
23
|
+
* 9895 is the integer code point of `⚧`, so a record's id identifies it as one of ours.
|
|
24
|
+
* The range holds one million ids, above every upstream WOF id and below every synthetic base.
|
|
25
|
+
*/
|
|
26
|
+
export const MAILWOMAN_WOF_ID_BASE = 9_895_000_000
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The first id past the `mailwoman` WOF range.
|
|
30
|
+
*/
|
|
31
|
+
export const MAILWOMAN_WOF_ID_END = 9_896_000_000
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Reports whether an id was minted in the `mailwoman` WOF range.
|
|
35
|
+
*/
|
|
36
|
+
export function isMailwomanWOFID(id: number): boolean {
|
|
37
|
+
return Number.isInteger(id) && id >= MAILWOMAN_WOF_ID_BASE && id < MAILWOMAN_WOF_ID_END
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The next free id in the `mailwoman` WOF range: one past the largest id already
|
|
42
|
+
* minted there, or the range's first id when none is.
|
|
43
|
+
* Ids outside the range are ignored.
|
|
44
|
+
*
|
|
45
|
+
* @throws When the range is exhausted.
|
|
46
|
+
*/
|
|
47
|
+
export function nextMailwomanWOFID(minted: Iterable<number>): number {
|
|
48
|
+
let largest = MAILWOMAN_WOF_ID_BASE - 1
|
|
49
|
+
|
|
50
|
+
for (const id of minted) {
|
|
51
|
+
if (isMailwomanWOFID(id) && id > largest) {
|
|
52
|
+
largest = id
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const next = largest + 1
|
|
57
|
+
|
|
58
|
+
if (next >= MAILWOMAN_WOF_ID_END) throw new Error(`the mailwoman WOF id range ends at ${MAILWOMAN_WOF_ID_END - 1}`)
|
|
59
|
+
|
|
60
|
+
return next
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Overture-sourced admin rows (`add-overture`).
|
|
21
65
|
*
|
|
22
66
|
* Above any real WOF id.
|
|
23
67
|
*/
|
|
24
68
|
export const OVERTURE_ID_BASE = 8_000_000_000_000
|
|
25
69
|
|
|
26
70
|
/**
|
|
27
|
-
* The GeoNames
|
|
71
|
+
* The places and aliases the GeoNames step adds (`@mailwoman/resolver-wof-sqlite/geonames`).
|
|
28
72
|
*/
|
|
29
73
|
export const GEONAMES_ID_BASE = 9_000_000_000_000
|
|
30
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Reports whether an id belongs to the Overture Divisions part of an admin or candidate gazetteer.
|
|
77
|
+
*
|
|
78
|
+
* The part is ODbL-1.0 and the rest of the file isn't, so a pass that reads one part's rows to
|
|
79
|
+
* change the other's needs this test, and the Overture part's offer selects its rows with it.
|
|
80
|
+
*/
|
|
81
|
+
export function isOverturePartID(id: number): boolean {
|
|
82
|
+
return id >= OVERTURE_ID_BASE && id < GEONAMES_ID_BASE
|
|
83
|
+
}
|
|
84
|
+
|
|
31
85
|
/**
|
|
32
86
|
* GeoNames postal rows (`@mailwoman/resolver-wof-sqlite/geonames`).
|
|
33
87
|
*/
|
|
34
88
|
export const GEONAMES_POSTAL_ID_BASE = 9_500_000_000_000
|
|
35
89
|
|
|
90
|
+
/**
|
|
91
|
+
* The id the GeoNames step gives the place GeoNames numbers `geonameid`:
|
|
92
|
+
* {@link GEONAMES_ID_BASE} plus that number.
|
|
93
|
+
*
|
|
94
|
+
* The id is computed from the GeoNames record's own number.
|
|
95
|
+
* A place keeps its id whichever other countries a build adds, and every build of
|
|
96
|
+
* one GeoNames dump numbers its places the same way.
|
|
97
|
+
*
|
|
98
|
+
* @throws When `geonameid` isn't a positive integer below the GeoNames range's width.
|
|
99
|
+
*/
|
|
100
|
+
export function geonamesPlaceID(geonameid: number): number {
|
|
101
|
+
if (!Number.isInteger(geonameid) || geonameid <= 0 || geonameid >= GEONAMES_POSTAL_ID_BASE - GEONAMES_ID_BASE) {
|
|
102
|
+
throw new RangeError(`geonameid ${geonameid} falls outside the GeoNames id range`)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return GEONAMES_ID_BASE + geonameid
|
|
106
|
+
}
|
|
107
|
+
|
|
36
108
|
/**
|
|
37
109
|
* The Dutch PC6 postcode database (`gazetteer build nl-pc6`).
|
|
38
110
|
*/
|
package/lib/resolver/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
|
|
4
|
-
import type { PlacetypeMap } from "@mailwoman/codex/placetype-map"
|
|
4
|
+
import type { PlacetypeMap } from "@mailwoman/codex/labels/placetype-map"
|
|
5
5
|
|
|
6
6
|
import type { AddressTree } from "#decoder/types"
|
|
7
7
|
import type { GazetteerArtifactCoverage } from "#resolver/coverage-facts"
|
|
@@ -12,6 +12,38 @@ import type {
|
|
|
12
12
|
StreetCentroidLookup,
|
|
13
13
|
} from "#resolver/lookup-types"
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Why a place's ranking score is a rank without a measurement behind it.
|
|
17
|
+
*
|
|
18
|
+
* `population_unrecorded`: the backend ranks by population and the gazetteer records
|
|
19
|
+
* none for the place, so its score is the rank an unknown population sorts to.
|
|
20
|
+
* `population_estimated`: the gazetteer records no population for the place,
|
|
21
|
+
* and its score ranks a population estimated from the settlement that contains it.
|
|
22
|
+
* `unrecorded`: the resolver recorded no score for the place.
|
|
23
|
+
*/
|
|
24
|
+
export const ScoreUnmeasuredReason = {
|
|
25
|
+
PopulationUnrecorded: "population_unrecorded",
|
|
26
|
+
PopulationEstimated: "population_estimated",
|
|
27
|
+
Unrecorded: "unrecorded",
|
|
28
|
+
} as const
|
|
29
|
+
|
|
30
|
+
export type ScoreUnmeasuredReason = (typeof ScoreUnmeasuredReason)[keyof typeof ScoreUnmeasuredReason]
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Why a candidate-table row's score, `-neg_rank` with `neg_rank = -log10(population + 1)`,
|
|
34
|
+
* has no measured population behind it, or null when it has one.
|
|
35
|
+
*
|
|
36
|
+
* A row with no population and a negative `neg_rank` was ranked by a population estimate.
|
|
37
|
+
*/
|
|
38
|
+
export function populationScoreUnmeasured(
|
|
39
|
+
population: number | null | undefined,
|
|
40
|
+
negRank: number
|
|
41
|
+
): ScoreUnmeasuredReason | null {
|
|
42
|
+
if (typeof population === "number" && population > 0) return null
|
|
43
|
+
|
|
44
|
+
return negRank < 0 ? ScoreUnmeasuredReason.PopulationEstimated : ScoreUnmeasuredReason.PopulationUnrecorded
|
|
45
|
+
}
|
|
46
|
+
|
|
15
47
|
export interface ResolvedPlace {
|
|
16
48
|
/**
|
|
17
49
|
* Resolver-specific place identifier.
|
|
@@ -43,8 +75,17 @@ export interface ResolvedPlace {
|
|
|
43
75
|
parent_id: number | string | null
|
|
44
76
|
/**
|
|
45
77
|
* Resolver-defined ranking score.
|
|
78
|
+
*
|
|
79
|
+
* The ranking stages compare it whether or not `scoreUnmeasured` is set.
|
|
46
80
|
*/
|
|
47
81
|
score: number
|
|
82
|
+
/**
|
|
83
|
+
* Why `score` and `prominence` are unmeasured for this place: each value is
|
|
84
|
+
* the rank an unmeasured input sorts to.
|
|
85
|
+
*
|
|
86
|
+
* Null or absent when the backend measured the score.
|
|
87
|
+
*/
|
|
88
|
+
scoreUnmeasured?: ScoreUnmeasuredReason | null
|
|
48
89
|
/**
|
|
49
90
|
* Optional backend prominence score.
|
|
50
91
|
*/
|
|
@@ -93,6 +134,13 @@ export interface ResolvedPlace {
|
|
|
93
134
|
* True when the input matched an alias of this place and differs from its primary name.
|
|
94
135
|
*/
|
|
95
136
|
matchedAlias?: true | null
|
|
137
|
+
/**
|
|
138
|
+
* True when a hard scope excluded this place: it lies outside the default country
|
|
139
|
+
* or the caller's parent place.
|
|
140
|
+
*
|
|
141
|
+
* The resolver sets it only on a place it lists on a node's `considered` list.
|
|
142
|
+
*/
|
|
143
|
+
outsideScope?: true | null
|
|
96
144
|
/**
|
|
97
145
|
* Optional stored extent.
|
|
98
146
|
* A point-only row stores its coordinate as both corners.
|
|
@@ -161,6 +209,10 @@ export interface ResolverBackend {
|
|
|
161
209
|
* Optional ancestor lineage lookup.
|
|
162
210
|
*/
|
|
163
211
|
ancestors?(id: number | string): Ancestor[]
|
|
212
|
+
/**
|
|
213
|
+
* Optional lookup of one place by its id, or null when the gazetteer holds no such place.
|
|
214
|
+
*/
|
|
215
|
+
place?(id: number): ResolvedPlace | null
|
|
164
216
|
/**
|
|
165
217
|
* Optional artifact coverage facts.
|
|
166
218
|
*/
|
|
@@ -219,6 +271,18 @@ export interface LandmarkHit {
|
|
|
219
271
|
*/
|
|
220
272
|
export const OSM_LANDMARK_PREFIX = "osm:"
|
|
221
273
|
|
|
274
|
+
/**
|
|
275
|
+
* Parses the resolver's `placeID` URI back to a WOF id, returning `null` for anything else
|
|
276
|
+
* so a future non-WOF backend isn't silently read as one.
|
|
277
|
+
*/
|
|
278
|
+
export function wofIDFromPlaceID(placeID: string | null): number | null {
|
|
279
|
+
if (!placeID) return null
|
|
280
|
+
|
|
281
|
+
const match = /^wof:(\d+)$/.exec(placeID)
|
|
282
|
+
|
|
283
|
+
return match ? Number(match[1]) : null
|
|
284
|
+
}
|
|
285
|
+
|
|
222
286
|
/**
|
|
223
287
|
* Returns a landmark's place ID: `openstreetmap:W427818536` or `wikidata:Q160409`.
|
|
224
288
|
*/
|
|
@@ -237,6 +301,46 @@ export interface LandmarkLookup {
|
|
|
237
301
|
find(name: string): LandmarkHit[] | Promise<LandmarkHit[]>
|
|
238
302
|
}
|
|
239
303
|
|
|
304
|
+
/**
|
|
305
|
+
* A former administrative division whose name an input wrote, with the current
|
|
306
|
+
* places its containment evidence ties it to.
|
|
307
|
+
*/
|
|
308
|
+
export interface FormerDivisionMatch {
|
|
309
|
+
name: string
|
|
310
|
+
/**
|
|
311
|
+
* Upper-case ISO 3166-1 alpha-2 code.
|
|
312
|
+
*/
|
|
313
|
+
country: string
|
|
314
|
+
/**
|
|
315
|
+
* The GeoNames feature code (`ADM1H`) or the WOF placetype of a ceased record.
|
|
316
|
+
*/
|
|
317
|
+
kind: string
|
|
318
|
+
/**
|
|
319
|
+
* The `ComponentTag` the division takes in an address.
|
|
320
|
+
*/
|
|
321
|
+
tag: string
|
|
322
|
+
geonamesID: number | null
|
|
323
|
+
wofID: number | null
|
|
324
|
+
/**
|
|
325
|
+
* WOF ids of the current places the division covered.
|
|
326
|
+
*/
|
|
327
|
+
linkedIDs: ReadonlySet<number>
|
|
328
|
+
/**
|
|
329
|
+
* The kinds of evidence the links rest on.
|
|
330
|
+
*/
|
|
331
|
+
evidence: readonly string[]
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Finds the former divisions a written name belongs to.
|
|
336
|
+
*/
|
|
337
|
+
export interface FormerDivisionLookup {
|
|
338
|
+
/**
|
|
339
|
+
* The former divisions whose name keys the same as `value`, in `country` when one is given.
|
|
340
|
+
*/
|
|
341
|
+
divisionsNamed(value: string, country: string | null): readonly FormerDivisionMatch[]
|
|
342
|
+
}
|
|
343
|
+
|
|
240
344
|
/**
|
|
241
345
|
* Who chose a default country scope.
|
|
242
346
|
*
|
|
@@ -246,6 +350,21 @@ export interface LandmarkLookup {
|
|
|
246
350
|
*/
|
|
247
351
|
export type DefaultCountrySource = "caller" | "inferred"
|
|
248
352
|
|
|
353
|
+
/**
|
|
354
|
+
* How a scope acts on a lookup.
|
|
355
|
+
*
|
|
356
|
+
* - `"hard"`: a filter.
|
|
357
|
+
* A candidate outside the scope never answers.
|
|
358
|
+
* - `"soft"`: a bounded prior.
|
|
359
|
+
* A candidate outside the scope still answers when it's much larger.
|
|
360
|
+
*/
|
|
361
|
+
export const ScopeStrength = {
|
|
362
|
+
Hard: "hard",
|
|
363
|
+
Soft: "soft",
|
|
364
|
+
} as const
|
|
365
|
+
|
|
366
|
+
export type ScopeStrength = (typeof ScopeStrength)[keyof typeof ScopeStrength]
|
|
367
|
+
|
|
249
368
|
/**
|
|
250
369
|
* A default top-level country scope for resolution.
|
|
251
370
|
*/
|
|
@@ -255,6 +374,38 @@ export interface DefaultCountry {
|
|
|
255
374
|
*/
|
|
256
375
|
country: string
|
|
257
376
|
source: DefaultCountrySource
|
|
377
|
+
/**
|
|
378
|
+
* How the scope acts on a lookup.
|
|
379
|
+
*
|
|
380
|
+
* Absent means `"hard"`.
|
|
381
|
+
*/
|
|
382
|
+
strength?: ScopeStrength
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* The country of a scope that filters lookups, or null when the scope is absent or soft.
|
|
387
|
+
*/
|
|
388
|
+
export function hardCountryOf(scope: DefaultCountry | null | undefined): string | null {
|
|
389
|
+
return scope && scope.strength !== ScopeStrength.Soft ? scope.country : null
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* A caller-supplied place that scopes every lookup of an address, such as a WOF borough or country.
|
|
394
|
+
*
|
|
395
|
+
* A hard parent keeps only candidates its ancestor lineage agrees with:
|
|
396
|
+
* the places inside it, the place itself and its ancestors.
|
|
397
|
+
* It also filters by the parent's country.
|
|
398
|
+
*
|
|
399
|
+
* A soft parent ranks the candidates it contains first and gives its country a soft scope.
|
|
400
|
+
* Both forms pass the parent to the backend as a containment qualifier.
|
|
401
|
+
*/
|
|
402
|
+
export interface ParentPlaceScope {
|
|
403
|
+
/**
|
|
404
|
+
* The gazetteer id of the parent place.
|
|
405
|
+
*/
|
|
406
|
+
id: number
|
|
407
|
+
source: DefaultCountrySource
|
|
408
|
+
strength: ScopeStrength
|
|
258
409
|
}
|
|
259
410
|
|
|
260
411
|
/**
|
|
@@ -277,6 +428,10 @@ export interface ResolveSwitches {
|
|
|
277
428
|
includeAncestors: boolean
|
|
278
429
|
adminContainmentRerank: boolean
|
|
279
430
|
dependentLocalityContainment: boolean
|
|
431
|
+
countyDesignatorFallback: boolean
|
|
432
|
+
formerDivisions: boolean
|
|
433
|
+
scopeCountryRetrieval: boolean
|
|
434
|
+
siblingLocalityContainment: boolean
|
|
280
435
|
diagnoseUnreachable: boolean
|
|
281
436
|
}
|
|
282
437
|
|
|
@@ -297,6 +452,10 @@ export const RESOLVE_SWITCH_DEFAULTS: Readonly<ResolveSwitches> = {
|
|
|
297
452
|
includeAncestors: false,
|
|
298
453
|
adminContainmentRerank: true,
|
|
299
454
|
dependentLocalityContainment: true,
|
|
455
|
+
countyDesignatorFallback: false,
|
|
456
|
+
formerDivisions: false,
|
|
457
|
+
scopeCountryRetrieval: false,
|
|
458
|
+
siblingLocalityContainment: false,
|
|
300
459
|
diagnoseUnreachable: false,
|
|
301
460
|
}
|
|
302
461
|
|
|
@@ -327,7 +486,7 @@ export interface ResolveOpts {
|
|
|
327
486
|
*/
|
|
328
487
|
candidatesPerLookup?: number
|
|
329
488
|
/**
|
|
330
|
-
* Default top-level country scope,
|
|
489
|
+
* Default top-level country scope, who chose it, and whether it filters or ranks.
|
|
331
490
|
*/
|
|
332
491
|
defaultCountry?: DefaultCountry
|
|
333
492
|
/**
|
|
@@ -361,13 +520,17 @@ export interface ResolveOpts {
|
|
|
361
520
|
*/
|
|
362
521
|
anchorWeight?: number
|
|
363
522
|
/**
|
|
364
|
-
*
|
|
523
|
+
* The bonus a soft country scope gives a candidate in its country, in log10-population units.
|
|
524
|
+
*
|
|
525
|
+
* @defaultValue `DEFAULT_COUNTRY_PRIOR_WEIGHT` from `@mailwoman/resolver/toponym-prior` (2)
|
|
365
526
|
*/
|
|
366
|
-
|
|
527
|
+
softCountryWeight?: number
|
|
367
528
|
/**
|
|
368
|
-
*
|
|
529
|
+
* A caller-supplied parent place that scopes every lookup.
|
|
530
|
+
*
|
|
531
|
+
* It needs a backend with `place` and `ancestors`, and the resolve throws without them.
|
|
369
532
|
*/
|
|
370
|
-
|
|
533
|
+
parentPlace?: ParentPlaceScope
|
|
371
534
|
/**
|
|
372
535
|
* Optional capital-level callback.
|
|
373
536
|
*/
|
|
@@ -522,6 +685,56 @@ export interface ResolveOpts {
|
|
|
522
685
|
* @defaultValue {@linkcode RESOLVE_SWITCH_DEFAULTS}
|
|
523
686
|
*/
|
|
524
687
|
dependentLocalityContainment?: boolean
|
|
688
|
+
/**
|
|
689
|
+
* Looks a `locality` span up as a WOF `county` in its resolved region
|
|
690
|
+
* when no locality of that name is there and the value is written with
|
|
691
|
+
* its country's county designator (`Harris County`, `Jefferson Parish`),
|
|
692
|
+
* from `countyNameWithoutDesignator` in `@mailwoman/codex/designators/county`.
|
|
693
|
+
*
|
|
694
|
+
* @defaultValue {@linkcode RESOLVE_SWITCH_DEFAULTS}
|
|
695
|
+
*/
|
|
696
|
+
countyDesignatorFallback?: boolean
|
|
697
|
+
/**
|
|
698
|
+
* Accepts a `subregion` or `region` value that no current division answers when the value is the name
|
|
699
|
+
* of a former division of {@link ResolveOpts.formerDivisionLookup} linked to the resolved locality.
|
|
700
|
+
*
|
|
701
|
+
* The accepted node keeps no place and scopes no lookup, and its metadata records the division.
|
|
702
|
+
*
|
|
703
|
+
* @defaultValue {@linkcode RESOLVE_SWITCH_DEFAULTS}
|
|
704
|
+
*/
|
|
705
|
+
formerDivisions?: boolean
|
|
706
|
+
/**
|
|
707
|
+
* The former divisions {@link ResolveOpts.formerDivisions} reads.
|
|
708
|
+
*
|
|
709
|
+
* Without it the switch leaves every node as the walk resolved it.
|
|
710
|
+
*/
|
|
711
|
+
formerDivisionLookup?: FormerDivisionLookup
|
|
712
|
+
/**
|
|
713
|
+
* Lets a soft country scope act inside retrieval.
|
|
714
|
+
*
|
|
715
|
+
* A region or locality lookup without a hard country also retrieves the soft
|
|
716
|
+
* country's rows and merges them by place id.
|
|
717
|
+
* A bounded bonus for that country then runs after the importance rerank, so the rerank can't undo it.
|
|
718
|
+
*
|
|
719
|
+
* The soft scope is the locale's country when the walk withholds it for a bare tree,
|
|
720
|
+
* or the locale head's country when the head contradicts the inferred scope.
|
|
721
|
+
* A lookup under a hard default country also probes without it and reports the
|
|
722
|
+
* same-name places outside the scope on `considered`.
|
|
723
|
+
*
|
|
724
|
+
* @defaultValue {@linkcode RESOLVE_SWITCH_DEFAULTS}
|
|
725
|
+
*/
|
|
726
|
+
scopeCountryRetrieval?: boolean
|
|
727
|
+
/**
|
|
728
|
+
* Resolves one of two `locality` spans inside the other when the gazetteer places
|
|
729
|
+
* a candidate of it inside the other's resolved place.
|
|
730
|
+
*
|
|
731
|
+
* The inner span is retagged `dependent_locality` and looked up with the outer place
|
|
732
|
+
* as its containment qualifier, as a written dependent locality is.
|
|
733
|
+
* The gazetteer decides which span is inner, so token order doesn't.
|
|
734
|
+
*
|
|
735
|
+
* @defaultValue {@linkcode RESOLVE_SWITCH_DEFAULTS}
|
|
736
|
+
*/
|
|
737
|
+
siblingLocalityContainment?: boolean
|
|
525
738
|
/**
|
|
526
739
|
* Optional sink for resolver-internal trace records.
|
|
527
740
|
*/
|
|
@@ -545,7 +758,17 @@ export interface ResolveCandidateTrace {
|
|
|
545
758
|
*/
|
|
546
759
|
country: string | null
|
|
547
760
|
placetype: string
|
|
761
|
+
/**
|
|
762
|
+
* The ranking key the stages compared.
|
|
763
|
+
* It is unmeasured when `scoreUnmeasured` is set.
|
|
764
|
+
*/
|
|
548
765
|
score: number
|
|
766
|
+
/**
|
|
767
|
+
* Why `score` and `prominence` are unmeasured, or null when they're measured.
|
|
768
|
+
*
|
|
769
|
+
* Optional because a trace recorded before the field existed holds no such entry.
|
|
770
|
+
*/
|
|
771
|
+
scoreUnmeasured?: ScoreUnmeasuredReason | null
|
|
549
772
|
prominence: number | null
|
|
550
773
|
importance: number | null
|
|
551
774
|
population: number | null
|
|
@@ -595,6 +818,8 @@ export interface ResolveNodeTrace {
|
|
|
595
818
|
| "empty_admin"
|
|
596
819
|
| "span_rescore"
|
|
597
820
|
| "postal_compound_recovery"
|
|
821
|
+
| "county_designator_fallback"
|
|
822
|
+
| "sibling_locality_containment"
|
|
598
823
|
} | null
|
|
599
824
|
}
|
|
600
825
|
|
package/lib/resolver.ts
CHANGED
|
@@ -32,14 +32,24 @@ export type {
|
|
|
32
32
|
AuthoritativeResponse,
|
|
33
33
|
} from "#resolver/authoritative-provider"
|
|
34
34
|
|
|
35
|
-
export type {
|
|
35
|
+
export type {
|
|
36
|
+
RegionDatabaseProvider,
|
|
37
|
+
RegionDatabases,
|
|
38
|
+
RegionLayerDatabase,
|
|
39
|
+
SourceLocation,
|
|
40
|
+
} from "#resolver/region-database-provider"
|
|
36
41
|
|
|
37
42
|
export {
|
|
38
43
|
EMPTY_PLACE_FIELDS,
|
|
44
|
+
hardCountryOf,
|
|
39
45
|
landmarkPlaceID,
|
|
40
46
|
OSM_LANDMARK_PREFIX,
|
|
47
|
+
populationScoreUnmeasured,
|
|
41
48
|
RESOLVE_SWITCH_DEFAULTS,
|
|
42
49
|
resolveSwitches,
|
|
50
|
+
ScopeStrength,
|
|
51
|
+
ScoreUnmeasuredReason,
|
|
52
|
+
wofIDFromPlaceID,
|
|
43
53
|
} from "#resolver/types"
|
|
44
54
|
|
|
45
55
|
export { hardCountrySafelistFromCoverage } from "#resolver/coverage-facts"
|
|
@@ -52,6 +62,7 @@ export type {
|
|
|
52
62
|
ResolveSwitches,
|
|
53
63
|
DefaultCountry,
|
|
54
64
|
DefaultCountrySource,
|
|
65
|
+
ParentPlaceScope,
|
|
55
66
|
ResolvedPlace,
|
|
56
67
|
Resolver,
|
|
57
68
|
ResolverBackend,
|
|
@@ -59,6 +70,8 @@ export type {
|
|
|
59
70
|
LandmarkHit,
|
|
60
71
|
LandmarkKind,
|
|
61
72
|
LandmarkLookup,
|
|
73
|
+
FormerDivisionLookup,
|
|
74
|
+
FormerDivisionMatch,
|
|
62
75
|
} from "#resolver/types"
|
|
63
76
|
|
|
64
77
|
export type {
|
package/lib/state-machine.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface StateMachine<
|
|
|
55
55
|
/**
|
|
56
56
|
* One event for each case the transition distinguishes, keyed by a label for that case.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
58
|
+
* `yarn mwops effects` applies every event to every state to print the machine's
|
|
59
59
|
* transition table, and a test can assert the same table.
|
|
60
60
|
*/
|
|
61
61
|
readonly events?: Readonly<Record<string, TEvent>>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
|
|
4
|
-
import { stringifyJSON } from "#json"
|
|
4
|
+
import { stringifyJSON } from "#values/json"
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Python's one-line `json.dumps`, kept for the two hashes whose recorded
|
|
@@ -11,7 +11,12 @@ import { stringifyJSON } from "#json"
|
|
|
11
11
|
* the encoder-parity records store it, so a sampler change verifies against the 15 records.
|
|
12
12
|
* The DeepSeek transliteration batch id in `packages/corpus/lib/recipes/deepseek/batches.ts` hashes the
|
|
13
13
|
* seed ids as the first requested batches did, so a resumed run skips the batches already requested.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* New output uses `orderedJSON` from `@mailwoman/core/values/json`.
|
|
16
|
+
*
|
|
17
|
+
* {@linkcode pythonJSONString} also prints the strings of a Who's On First
|
|
18
|
+
* record (`@mailwoman/gazetteer/tools/pipeline/wof/record`).
|
|
19
|
+
* The WOF exporter is a Python `json` writer.
|
|
15
20
|
*/
|
|
16
21
|
|
|
17
22
|
/**
|
|
@@ -25,7 +30,12 @@ export interface PythonJSONOptions {
|
|
|
25
30
|
ensureASCII?: boolean
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
/**
|
|
34
|
+
* One string as Python's `json.dumps` writes it, with `ensure_ascii` on unless `ensureASCII` is false.
|
|
35
|
+
*
|
|
36
|
+
* The WOF record writer prints every string through it, because the WOF exporter is a Python `json` writer.
|
|
37
|
+
*/
|
|
38
|
+
export function pythonJSONString(value: string, ensureASCII = true): string {
|
|
29
39
|
// JSON.stringify escapes the quote, the backslash and the C0 controls as Python's json does.
|
|
30
40
|
// Python's `ensure_ascii` also escapes DEL and every code unit above it, one `\uXXXX` per UTF-16 unit.
|
|
31
41
|
const out = stringifyJSON(value)
|
|
@@ -55,7 +65,7 @@ function pythonValue(value: unknown, options: Required<PythonJSONOptions>): stri
|
|
|
55
65
|
return Object.is(value, -0) ? "0" : String(value)
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
if (typeof value === "string") return
|
|
68
|
+
if (typeof value === "string") return pythonJSONString(value, options.ensureASCII)
|
|
59
69
|
|
|
60
70
|
if (Array.isArray(value)) return `[${value.map((item) => pythonValue(item, options)).join(", ")}]`
|
|
61
71
|
|
|
@@ -67,7 +77,7 @@ function pythonValue(value: unknown, options: Required<PythonJSONOptions>): stri
|
|
|
67
77
|
}
|
|
68
78
|
|
|
69
79
|
const items = entries.map(
|
|
70
|
-
([key, item]) => `${
|
|
80
|
+
([key, item]) => `${pythonJSONString(key, options.ensureASCII)}: ${pythonValue(item, options)}`
|
|
71
81
|
)
|
|
72
82
|
|
|
73
83
|
return `{${items.join(", ")}}`
|
package/lib/tokenization/Span.ts
CHANGED
|
@@ -18,6 +18,18 @@ import { type Classification, type ClassificationMatch, ClassificationsMatchMap
|
|
|
18
18
|
|
|
19
19
|
const MAX_SPAN_LENGTH = 140
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* A piece of text with half-open UTF-16 offsets into the string it was read from.
|
|
23
|
+
*
|
|
24
|
+
* It is the plain shape that tokenizers hand to alignment code, and unlike a
|
|
25
|
+
* {@link Span} it holds no classifications or children.
|
|
26
|
+
*/
|
|
27
|
+
export interface TextFragment {
|
|
28
|
+
text: string
|
|
29
|
+
start: number
|
|
30
|
+
end: number
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
export interface SpanCreationOptions {
|
|
22
34
|
start?: number
|
|
23
35
|
classifications?: Iterable<Classification>
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
import { TextSpliterator } from "spliterator"
|
|
28
28
|
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
29
|
+
import { spawnProcess } from "#scripting/process"
|
|
30
|
+
import { parseJSONStrict } from "#values/json"
|
|
31
31
|
|
|
32
32
|
export interface RunChunkProcessOptions {
|
|
33
33
|
/**
|
|
@@ -18,7 +18,7 @@ import { PathBuilder, type PathBuilderLike } from "path-ts"
|
|
|
18
18
|
|
|
19
19
|
import { tryStat } from "#fs/readers/stat"
|
|
20
20
|
import { makeDirectories } from "#fs/writers"
|
|
21
|
-
import { runFile } from "#process"
|
|
21
|
+
import { runFile } from "#scripting/process"
|
|
22
22
|
import { streamToDisk } from "#utils/stream-to-disk"
|
|
23
23
|
|
|
24
24
|
/**
|