@mailwoman/core 8.1.0 → 8.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/api/APIClient.ts +3 -4
- package/api/responses.ts +6 -3
- package/coarse-placer/coarse-placer.ts +26 -11
- package/coarse-placer/featurize.ts +25 -16
- package/coarse-placer/tools/build-dataset.ts +42 -18
- package/coarse-placer/tools/build-outlier-exposure.ts +51 -18
- package/coarse-placer/tools/build-outlier-latin.ts +48 -22
- package/coarse-placer/tools/build-outlier-oa.ts +52 -20
- package/coarse-placer/tools/eval-latin-offmap.ts +37 -12
- package/coarse-placer/tools/eval-openset.ts +104 -37
- package/coarse-placer/tools/eval-quant-compare.ts +41 -11
- package/coarse-placer/tools/eval.ts +51 -13
- package/coarse-placer/tools/fnv-hash.ts +5 -3
- package/coarse-placer/tools/probe-frontier.ts +63 -32
- package/coarse-placer/tools/quantize.ts +30 -8
- package/coarse-placer/tools/train.ts +63 -17
- package/collections.ts +2 -2
- package/decoder/build-tree.ts +16 -3
- package/decoder/calibration.ts +23 -7
- package/decoder/containment.ts +3 -1
- package/decoder/proposals-to-tree.ts +2 -0
- package/decoder/resolve-proposal-overlaps.ts +5 -1
- package/decoder/serialize-json.ts +8 -2
- package/decoder/serialize-tuples.ts +7 -2
- package/decoder/serialize-xml.ts +29 -11
- package/decoder/types.ts +34 -12
- package/decoder/unknown-spans.ts +14 -5
- package/decoder/validate-tree.ts +6 -1
- package/env/index.ts +1 -1
- package/env/load.ts +1 -1
- package/env/paths.ts +1 -1
- package/env/schema.ts +12 -4
- package/errors/schema.ts +1 -1
- package/fs/node.ts +9 -10
- package/identifiers.ts +3 -3
- package/kysley/adapter.ts +1 -1
- package/layers/manifest.ts +22 -8
- package/layers/schema.ts +59 -19
- package/locale/locale.ts +6 -2
- package/locale/profiles/en-us.ts +3 -0
- package/locale/profiles/fr-fr.ts +3 -0
- package/locale/profiles/ja-jp.ts +6 -0
- package/locale/registry.ts +3 -1
- package/logging/shared.ts +1 -0
- package/logging/utils.ts +1 -1
- package/objects.ts +7 -2
- package/out/api/APIClient.d.ts +1 -1
- package/out/api/APIClient.d.ts.map +1 -1
- package/out/api/APIClient.js +3 -2
- package/out/api/APIClient.js.map +1 -1
- package/out/api/responses.d.ts.map +1 -1
- package/out/api/responses.js +3 -3
- package/out/api/responses.js.map +1 -1
- package/out/coarse-placer/coarse-placer.d.ts +19 -9
- package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
- package/out/coarse-placer/coarse-placer.js +6 -4
- package/out/coarse-placer/coarse-placer.js.map +1 -1
- package/out/coarse-placer/featurize.d.ts.map +1 -1
- package/out/coarse-placer/featurize.js +20 -16
- package/out/coarse-placer/featurize.js.map +1 -1
- package/out/coarse-placer/tools/build-dataset.d.ts +15 -5
- package/out/coarse-placer/tools/build-dataset.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-dataset.js +19 -14
- package/out/coarse-placer/tools/build-dataset.js.map +1 -1
- package/out/coarse-placer/tools/build-outlier-exposure.d.ts +21 -7
- package/out/coarse-placer/tools/build-outlier-exposure.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-outlier-exposure.js +24 -12
- package/out/coarse-placer/tools/build-outlier-exposure.js.map +1 -1
- package/out/coarse-placer/tools/build-outlier-latin.d.ts +18 -6
- package/out/coarse-placer/tools/build-outlier-latin.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-outlier-latin.js +27 -17
- package/out/coarse-placer/tools/build-outlier-latin.js.map +1 -1
- package/out/coarse-placer/tools/build-outlier-oa.d.ts +18 -6
- package/out/coarse-placer/tools/build-outlier-oa.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-outlier-oa.js +29 -15
- package/out/coarse-placer/tools/build-outlier-oa.js.map +1 -1
- package/out/coarse-placer/tools/eval-latin-offmap.d.ts +18 -6
- package/out/coarse-placer/tools/eval-latin-offmap.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval-latin-offmap.js +13 -7
- package/out/coarse-placer/tools/eval-latin-offmap.js.map +1 -1
- package/out/coarse-placer/tools/eval-openset.d.ts +24 -8
- package/out/coarse-placer/tools/eval-openset.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval-openset.js +52 -31
- package/out/coarse-placer/tools/eval-openset.js.map +1 -1
- package/out/coarse-placer/tools/eval-quant-compare.d.ts +30 -10
- package/out/coarse-placer/tools/eval-quant-compare.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval-quant-compare.js +4 -2
- package/out/coarse-placer/tools/eval-quant-compare.js.map +1 -1
- package/out/coarse-placer/tools/eval.d.ts +24 -8
- package/out/coarse-placer/tools/eval.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval.js +16 -6
- package/out/coarse-placer/tools/eval.js.map +1 -1
- package/out/coarse-placer/tools/fnv-hash.d.ts +3 -1
- package/out/coarse-placer/tools/fnv-hash.d.ts.map +1 -1
- package/out/coarse-placer/tools/fnv-hash.js +5 -3
- package/out/coarse-placer/tools/fnv-hash.js.map +1 -1
- package/out/coarse-placer/tools/probe-frontier.d.ts +18 -6
- package/out/coarse-placer/tools/probe-frontier.d.ts.map +1 -1
- package/out/coarse-placer/tools/probe-frontier.js +39 -23
- package/out/coarse-placer/tools/probe-frontier.js.map +1 -1
- package/out/coarse-placer/tools/quantize.d.ts +15 -5
- package/out/coarse-placer/tools/quantize.d.ts.map +1 -1
- package/out/coarse-placer/tools/quantize.js +11 -4
- package/out/coarse-placer/tools/quantize.js.map +1 -1
- package/out/coarse-placer/tools/train.d.ts +24 -8
- package/out/coarse-placer/tools/train.d.ts.map +1 -1
- package/out/coarse-placer/tools/train.js +24 -10
- package/out/coarse-placer/tools/train.js.map +1 -1
- package/out/collections.js +2 -2
- package/out/collections.js.map +1 -1
- package/out/decoder/build-tree.d.ts.map +1 -1
- package/out/decoder/build-tree.js +9 -3
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/calibration.d.ts +17 -3
- package/out/decoder/calibration.d.ts.map +1 -1
- package/out/decoder/calibration.js +12 -4
- package/out/decoder/calibration.js.map +1 -1
- package/out/decoder/containment.d.ts +3 -1
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js +3 -1
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/proposals-to-tree.d.ts.map +1 -1
- package/out/decoder/proposals-to-tree.js.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.js +5 -1
- package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
- package/out/decoder/serialize-json.d.ts +6 -2
- package/out/decoder/serialize-json.d.ts.map +1 -1
- package/out/decoder/serialize-json.js.map +1 -1
- package/out/decoder/serialize-tuples.d.ts +6 -2
- package/out/decoder/serialize-tuples.d.ts.map +1 -1
- package/out/decoder/serialize-tuples.js.map +1 -1
- package/out/decoder/serialize-xml.d.ts +21 -7
- package/out/decoder/serialize-xml.d.ts.map +1 -1
- package/out/decoder/serialize-xml.js +7 -5
- package/out/decoder/serialize-xml.js.map +1 -1
- package/out/decoder/types.d.ts +34 -12
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +1 -1
- package/out/decoder/types.js.map +1 -1
- package/out/decoder/unknown-spans.d.ts +9 -3
- package/out/decoder/unknown-spans.d.ts.map +1 -1
- package/out/decoder/unknown-spans.js +4 -2
- package/out/decoder/unknown-spans.js.map +1 -1
- package/out/decoder/validate-tree.d.ts +3 -1
- package/out/decoder/validate-tree.d.ts.map +1 -1
- package/out/decoder/validate-tree.js +3 -1
- package/out/decoder/validate-tree.js.map +1 -1
- package/out/env/index.js +0 -1
- package/out/env/index.js.map +1 -1
- package/out/env/load.js +1 -1
- package/out/env/load.js.map +1 -1
- package/out/env/paths.js +1 -1
- package/out/env/paths.js.map +1 -1
- package/out/env/schema.d.ts.map +1 -1
- package/out/env/schema.js +12 -4
- package/out/env/schema.js.map +1 -1
- package/out/errors/schema.js +1 -1
- package/out/errors/schema.js.map +1 -1
- package/out/fs/node.d.ts +1 -2
- package/out/fs/node.d.ts.map +1 -1
- package/out/fs/node.js +7 -8
- package/out/fs/node.js.map +1 -1
- package/out/identifiers.js +3 -3
- package/out/identifiers.js.map +1 -1
- package/out/kysley/adapter.d.ts +1 -1
- package/out/kysley/adapter.d.ts.map +1 -1
- package/out/kysley/adapter.js +1 -1
- package/out/kysley/adapter.js.map +1 -1
- package/out/layers/manifest.d.ts +18 -6
- package/out/layers/manifest.d.ts.map +1 -1
- package/out/layers/manifest.js +8 -4
- package/out/layers/manifest.js.map +1 -1
- package/out/layers/schema.d.ts +57 -19
- package/out/layers/schema.d.ts.map +1 -1
- package/out/layers/schema.js +24 -8
- package/out/layers/schema.js.map +1 -1
- package/out/locale/locale.d.ts +6 -2
- package/out/locale/locale.d.ts.map +1 -1
- package/out/locale/profiles/en-us.d.ts +3 -0
- package/out/locale/profiles/en-us.d.ts.map +1 -1
- package/out/locale/profiles/en-us.js +3 -0
- package/out/locale/profiles/en-us.js.map +1 -1
- package/out/locale/profiles/fr-fr.d.ts +3 -0
- package/out/locale/profiles/fr-fr.d.ts.map +1 -1
- package/out/locale/profiles/fr-fr.js +3 -0
- package/out/locale/profiles/fr-fr.js.map +1 -1
- package/out/locale/profiles/ja-jp.d.ts +3 -0
- package/out/locale/profiles/ja-jp.d.ts.map +1 -1
- package/out/locale/profiles/ja-jp.js +6 -0
- package/out/locale/profiles/ja-jp.js.map +1 -1
- package/out/locale/registry.d.ts +3 -1
- package/out/locale/registry.d.ts.map +1 -1
- package/out/locale/registry.js +3 -1
- package/out/locale/registry.js.map +1 -1
- package/out/logging/shared.d.ts.map +1 -1
- package/out/logging/shared.js +1 -0
- package/out/logging/shared.js.map +1 -1
- package/out/logging/utils.js +1 -1
- package/out/logging/utils.js.map +1 -1
- package/out/objects.d.ts.map +1 -1
- package/out/objects.js +2 -2
- package/out/objects.js.map +1 -1
- package/out/pipeline/index.d.ts +2 -2
- package/out/pipeline/index.d.ts.map +1 -1
- package/out/pipeline/index.js +1 -1
- package/out/pipeline/index.js.map +1 -1
- package/out/pipeline/reconcile-lookups.d.ts.map +1 -1
- package/out/pipeline/reconcile-lookups.js.map +1 -1
- package/out/pipeline/reconcile.d.ts +30 -10
- package/out/pipeline/reconcile.d.ts.map +1 -1
- package/out/pipeline/reconcile.js +12 -9
- package/out/pipeline/reconcile.js.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +18 -0
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +73 -46
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
- package/out/pipeline/span-logit-aggregation.js +5 -2
- package/out/pipeline/span-logit-aggregation.js.map +1 -1
- package/out/pipeline/span-proposer.d.ts +19 -9
- package/out/pipeline/span-proposer.d.ts.map +1 -1
- package/out/pipeline/span-proposer.js +42 -22
- package/out/pipeline/span-proposer.js.map +1 -1
- package/out/pipeline/types.d.ts +77 -19
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +16 -0
- package/out/pipeline/types.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 +2 -3
- package/out/policy/proposal-collection.js.map +1 -1
- package/out/policy/registry.d.ts +9 -3
- package/out/policy/registry.d.ts.map +1 -1
- package/out/policy/registry.js +9 -3
- package/out/policy/registry.js.map +1 -1
- package/out/resolver/index.d.ts.map +1 -1
- package/out/resolver/types.d.ts +94 -30
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +7 -1
- package/out/resolver/types.js.map +1 -1
- package/out/resources/LocaleIndex.d.ts +1 -1
- package/out/resources/LocaleIndex.d.ts.map +1 -1
- package/out/resources/LocaleIndex.js +1 -2
- package/out/resources/LocaleIndex.js.map +1 -1
- package/out/resources/ResourceMapCache.d.ts.map +1 -1
- package/out/resources/ResourceMapCache.js +1 -1
- package/out/resources/ResourceMapCache.js.map +1 -1
- package/out/resources/collections.d.ts.map +1 -1
- package/out/resources/collections.js +3 -1
- package/out/resources/collections.js.map +1 -1
- package/out/resources/languages/index.d.ts +1 -1
- package/out/resources/languages/index.d.ts.map +1 -1
- package/out/resources/languages/index.js +1 -1
- package/out/resources/languages/index.js.map +1 -1
- package/out/resources/libpostal.d.ts +1 -1
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/libpostal.js +7 -5
- package/out/resources/libpostal.js.map +1 -1
- package/out/resources/set.js +6 -6
- package/out/resources/set.js.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.d.ts +1 -4
- package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.js +1 -20
- package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js +2 -2
- package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
- package/out/resources/whosonfirst/backoff.d.ts +19 -0
- package/out/resources/whosonfirst/backoff.d.ts.map +1 -0
- package/out/resources/whosonfirst/backoff.js +35 -0
- package/out/resources/whosonfirst/backoff.js.map +1 -0
- package/out/resources/whosonfirst/loader.d.ts +1 -1
- package/out/resources/whosonfirst/loader.d.ts.map +1 -1
- package/out/resources/whosonfirst/loader.js +0 -1
- package/out/resources/whosonfirst/loader.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts +4 -1
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.js +8 -6
- package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +6 -4
- package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.js +8 -4
- package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/definition.d.ts +5 -6
- package/out/resources/whosonfirst/placetypes/definition.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/definition.js +3 -0
- package/out/resources/whosonfirst/placetypes/definition.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.d.ts +4 -2
- package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.js +0 -0
- package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts +4 -2
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js +0 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.d.ts +1 -1
- package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.js +0 -1
- package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
- package/out/routing/index.d.ts.map +1 -1
- package/out/routing/index.js +1 -1
- package/out/routing/index.js.map +1 -1
- package/out/scripting/utils/index.d.ts +3 -1
- package/out/scripting/utils/index.d.ts.map +1 -1
- package/out/scripting/utils/index.js +3 -1
- package/out/scripting/utils/index.js.map +1 -1
- package/out/tokenization/Span.js.map +1 -1
- package/out/tokenization/normalizer.js +11 -11
- package/out/tokenization/normalizer.js.map +1 -1
- package/out/tools/download-libpostal-resources.d.ts.map +1 -1
- package/out/tools/download-libpostal-resources.js.map +1 -1
- package/out/tools/download-ssl-address.d.ts +9 -3
- package/out/tools/download-ssl-address.d.ts.map +1 -1
- package/out/tools/download-ssl-address.js +8 -4
- package/out/tools/download-ssl-address.js.map +1 -1
- package/out/tools/generate-language-types.d.ts +12 -4
- package/out/tools/generate-language-types.d.ts.map +1 -1
- package/out/tools/generate-language-types.js +3 -1
- package/out/tools/generate-language-types.js.map +1 -1
- package/out/types/Classification.d.ts.map +1 -1
- package/out/types/Classification.js.map +1 -1
- package/out/types/classifier.d.ts +27 -9
- package/out/types/classifier.d.ts.map +1 -1
- package/out/types/component.d.ts +8 -4
- package/out/types/component.d.ts.map +1 -1
- package/out/types/component.js +3 -3
- package/out/types/component.js.map +1 -1
- package/out/utils/data-root.d.ts +3 -1
- package/out/utils/data-root.d.ts.map +1 -1
- package/out/utils/data-root.js +3 -1
- package/out/utils/data-root.js.map +1 -1
- package/out/utils/hash.d.ts +6 -2
- package/out/utils/hash.d.ts.map +1 -1
- package/out/utils/hash.js +6 -2
- package/out/utils/hash.js.map +1 -1
- package/out/utils/jsonl.d.ts +9 -3
- package/out/utils/jsonl.d.ts.map +1 -1
- package/out/utils/jsonl.js +9 -3
- package/out/utils/jsonl.js.map +1 -1
- package/out/utils/python-json.d.ts +6 -2
- package/out/utils/python-json.d.ts.map +1 -1
- package/out/utils/python-json.js +9 -3
- package/out/utils/python-json.js.map +1 -1
- package/out/utils/python-random.d.ts +15 -5
- package/out/utils/python-random.d.ts.map +1 -1
- package/out/utils/python-random.js +17 -7
- package/out/utils/python-random.js.map +1 -1
- package/out/utils/repo.d.ts +4 -0
- package/out/utils/repo.d.ts.map +1 -1
- package/out/utils/repo.js +4 -0
- package/out/utils/repo.js.map +1 -1
- package/out/utils/sealed-db.d.ts +6 -2
- package/out/utils/sealed-db.d.ts.map +1 -1
- package/out/utils/sealed-db.js +6 -2
- package/out/utils/sealed-db.js.map +1 -1
- package/out/utils/stats.d.ts +9 -3
- package/out/utils/stats.d.ts.map +1 -1
- package/out/utils/stats.js +11 -5
- package/out/utils/stats.js.map +1 -1
- package/package.json +2 -2
- package/pipeline/index.ts +5 -1
- package/pipeline/reconcile-lookups.ts +3 -0
- package/pipeline/reconcile.ts +65 -24
- package/pipeline/runtime-pipeline.ts +95 -46
- package/pipeline/span-logit-aggregation.ts +7 -2
- package/pipeline/span-proposer.ts +95 -34
- package/pipeline/types.ts +88 -19
- package/policy/proposal-collection.ts +4 -3
- package/policy/registry.ts +13 -3
- package/resolver/index.ts +1 -0
- package/resolver/types.ts +95 -30
- package/resources/LocaleIndex.ts +2 -2
- package/resources/ResourceMapCache.ts +3 -2
- package/resources/collections.ts +4 -1
- package/resources/languages/index.ts +2 -1
- package/resources/libpostal.ts +6 -3
- package/resources/set.ts +6 -6
- package/resources/whosonfirst/DataSourceCache.ts +2 -24
- package/resources/whosonfirst/PlacetypeDataSource.ts +2 -2
- package/resources/whosonfirst/backoff.ts +39 -0
- package/resources/whosonfirst/loader.ts +2 -1
- package/resources/whosonfirst/placetypes/Placetype.ts +9 -6
- package/resources/whosonfirst/placetypes/admin.ts +12 -7
- package/resources/whosonfirst/placetypes/definition.ts +6 -6
- package/resources/whosonfirst/placetypes/graph.ts +0 -0
- package/resources/whosonfirst/placetypes/mermaid.ts +5 -2
- package/resources/whosonfirst/placetypes/tree.ts +1 -1
- package/routing/index.ts +5 -1
- package/scripting/utils/index.ts +3 -1
- package/tokenization/Span.ts +1 -1
- package/tokenization/normalizer.ts +11 -11
- package/tools/download-libpostal-resources.ts +1 -0
- package/tools/download-ssl-address.ts +19 -7
- package/tools/generate-language-types.ts +12 -4
- package/types/Classification.ts +5 -0
- package/types/classifier.ts +27 -9
- package/types/component.ts +9 -5
- package/utils/data-root.ts +3 -1
- package/utils/hash.ts +6 -2
- package/utils/jsonl.ts +11 -3
- package/utils/python-json.ts +13 -4
- package/utils/python-random.ts +17 -7
- package/utils/repo.ts +8 -0
- package/utils/sealed-db.ts +10 -2
- package/utils/stats.ts +11 -5
package/out/types/component.js
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
* - Street-level (Phase 2): house_number, street, street_prefix*, street_suffix, intersection_a/b, unit
|
|
24
24
|
* - Venue-level (Phase 3): venue, attention, po_box
|
|
25
25
|
* - FR-specific: cedex
|
|
26
|
-
* - JP-specific (Phase
|
|
27
|
-
* building_number, building_name
|
|
26
|
+
* - JP-specific (ACTIVATED at CJK Phase 2, 2026-07-29 — the JP char model's 47-label head trains against them; the Latin
|
|
27
|
+
* model never emits them): prefecture, municipality, district, block, sub_block, building_number, building_name
|
|
28
28
|
*/
|
|
29
29
|
export const COMPONENT_TAGS = [
|
|
30
30
|
// Universal
|
|
@@ -49,7 +49,7 @@ export const COMPONENT_TAGS = [
|
|
|
49
49
|
"po_box",
|
|
50
50
|
// FR-specific
|
|
51
51
|
"cedex",
|
|
52
|
-
// JP-specific (Phase
|
|
52
|
+
// JP-specific (ACTIVATED at CJK Phase 2 — the stage3-jp label set; Latin models never emit these)
|
|
53
53
|
"prefecture",
|
|
54
54
|
"municipality",
|
|
55
55
|
"district",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../types/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;IACV,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,eAAe;IACf,cAAc;IACd,QAAQ;IACR,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,MAAM;IACN,cAAc;IACd,OAAO;IACP,WAAW;IACX,QAAQ;IACR,cAAc;IACd,OAAO;IACP,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../types/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;IACV,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,eAAe;IACf,cAAc;IACd,QAAQ;IACR,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,MAAM;IACN,cAAc;IACd,OAAO;IACP,WAAW;IACX,QAAQ;IACR,cAAc;IACd,OAAO;IACP,kGAAkG;IAClG,YAAY;IACZ,cAAc;IACd,UAAU;IACV,OAAO;IACP,WAAW;IACX,iBAAiB;IACjB,eAAe;CACN,CAAA;AAOV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,CAAU,CAAC,CAAU,CAAA"}
|
package/out/utils/data-root.d.ts
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* {@link dataRootPath} rather than re-deriving the string. Going public, this is the only file that
|
|
11
11
|
* names the operator's filesystem layout; everything else reads `$MAILWOMAN_DATA_ROOT`.
|
|
12
12
|
*/
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* The Mailwoman data root: `$MAILWOMAN_DATA_ROOT` when set, else the lab default.
|
|
15
|
+
*/
|
|
14
16
|
export declare function mailwomanDataRoot(): string;
|
|
15
17
|
/**
|
|
16
18
|
* Build an absolute path under the data root, e.g. `dataRootPath("wof", "admin-global-priority.db")`. Reads the env on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-root.d.ts","sourceRoot":"","sources":["../../utils/data-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH
|
|
1
|
+
{"version":3,"file":"data-root.d.ts","sourceRoot":"","sources":["../../utils/data-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE1D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,GAAE,MAA4B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAW9G"}
|
package/out/utils/data-root.js
CHANGED
|
@@ -17,7 +17,9 @@ import { $public } from "../env/index.js";
|
|
|
17
17
|
* {@link mailwomanDataRoot}; override per-deployment with `$MAILWOMAN_DATA_ROOT`.
|
|
18
18
|
*/
|
|
19
19
|
const DEFAULT_MAILWOMAN_DATA_ROOT = "/mnt/playpen/mailwoman-data";
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The Mailwoman data root: `$MAILWOMAN_DATA_ROOT` when set, else the lab default.
|
|
22
|
+
*/
|
|
21
23
|
export function mailwomanDataRoot() {
|
|
22
24
|
return $public.MAILWOMAN_DATA_ROOT ?? DEFAULT_MAILWOMAN_DATA_ROOT;
|
|
23
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-root.js","sourceRoot":"","sources":["../../utils/data-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC;;;GAGG;AACH,MAAM,2BAA2B,GAAG,6BAA6B,CAAA;AAEjE
|
|
1
|
+
{"version":3,"file":"data-root.js","sourceRoot":"","sources":["../../utils/data-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC;;;GAGG;AACH,MAAM,2BAA2B,GAAG,6BAA6B,CAAA;AAEjE;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAChC,OAAO,OAAO,CAAC,mBAAmB,IAAI,2BAA2B,CAAA;AAClE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAG,QAAkB;IACjD,OAAO,WAAW,CAAC,iBAAiB,EAAE,EAAE,GAAG,QAAQ,CAAC,CAAA;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB,iBAAiB,EAAE;IACnE,gCAAgC;IAChC,OAAO;QACN,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,0BAA0B,CAAC;QACxD,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,kBAAkB,CAAC;QAChD,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,6BAA6B,CAAC;QAC3D,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,oBAAoB,CAAC;QAClD,gGAAgG;QAChG,iGAAiG;QACjG,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,sBAAsB,CAAC;KACpD,CAAA;AACF,CAAC"}
|
package/out/utils/hash.d.ts
CHANGED
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
* File/content hashing — the canonical home for the ~12 `sha256OfFile` clones the 2026-07-09
|
|
7
7
|
* dedupe survey found across the corpus fetch scripts.
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Streaming SHA-256 of a file, hex-encoded.
|
|
11
|
+
*/
|
|
10
12
|
export declare function sha256File(path: string): Promise<string>;
|
|
11
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* SHA-256 of in-memory content, hex-encoded.
|
|
15
|
+
*/
|
|
12
16
|
export declare function sha256Hex(data: string | NodeJS.ArrayBufferView): string;
|
|
13
17
|
/**
|
|
14
18
|
* Streaming MD5 of a file, hex-encoded. MD5 (not SHA-256) is used for build-provenance fingerprints that follow an
|
package/out/utils/hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../utils/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../utils/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ9D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,GAAG,MAAM,CAEvE;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ3D"}
|
package/out/utils/hash.js
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import { createReadStream } from "node:fs";
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Streaming SHA-256 of a file, hex-encoded.
|
|
13
|
+
*/
|
|
12
14
|
export async function sha256File(path) {
|
|
13
15
|
const hash = createHash("sha256");
|
|
14
16
|
for await (const chunk of createReadStream(path)) {
|
|
@@ -16,7 +18,9 @@ export async function sha256File(path) {
|
|
|
16
18
|
}
|
|
17
19
|
return hash.digest("hex");
|
|
18
20
|
}
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* SHA-256 of in-memory content, hex-encoded.
|
|
23
|
+
*/
|
|
20
24
|
export function sha256Hex(data) {
|
|
21
25
|
return createHash("sha256").update(data).digest("hex");
|
|
22
26
|
}
|
package/out/utils/hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../utils/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../utils/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IAEjC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,KAAe,CAAC,CAAA;IAC7B,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAqC;IAC9D,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACvD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAY;IACzC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAE9B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,KAAe,CAAC,CAAA;IAC7B,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC"}
|
package/out/utils/jsonl.d.ts
CHANGED
|
@@ -7,10 +7,16 @@
|
|
|
7
7
|
* re-rolled across ~88 scripts (2026-07-09 dedupe survey). `iterateJSONL` streams via spliterator
|
|
8
8
|
* for files too large to slurp.
|
|
9
9
|
*/
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Read an entire JSONL file into memory. Blank and whitespace-only lines are skipped.
|
|
12
|
+
*/
|
|
11
13
|
export declare function readJSONL<T>(path: string): T[];
|
|
12
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Write rows as JSONL (one `JSON.stringify` per line, trailing newline). Returns the row count.
|
|
16
|
+
*/
|
|
13
17
|
export declare function writeJSONL(path: string, rows: Iterable<unknown>): number;
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Stream a JSONL file row-by-row without loading it whole. Blank lines are skipped.
|
|
20
|
+
*/
|
|
15
21
|
export declare function iterateJSONL<T>(path: string): AsyncIterable<T>;
|
|
16
22
|
//# sourceMappingURL=jsonl.d.ts.map
|
package/out/utils/jsonl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../utils/jsonl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH
|
|
1
|
+
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../utils/jsonl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,CAK9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,MAAM,CAaxE;AAED;;GAEG;AACH,wBAAuB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAKrE"}
|
package/out/utils/jsonl.js
CHANGED
|
@@ -9,14 +9,18 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { TextSpliterator } from "spliterator";
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Read an entire JSONL file into memory. Blank and whitespace-only lines are skipped.
|
|
14
|
+
*/
|
|
13
15
|
export function readJSONL(path) {
|
|
14
16
|
return readFileSync(path, "utf8")
|
|
15
17
|
.split("\n")
|
|
16
18
|
.filter((line) => line.trim().length > 0)
|
|
17
19
|
.map((line) => JSON.parse(line));
|
|
18
20
|
}
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Write rows as JSONL (one `JSON.stringify` per line, trailing newline). Returns the row count.
|
|
23
|
+
*/
|
|
20
24
|
export function writeJSONL(path, rows) {
|
|
21
25
|
let count = 0;
|
|
22
26
|
let out = "";
|
|
@@ -27,7 +31,9 @@ export function writeJSONL(path, rows) {
|
|
|
27
31
|
writeFileSync(path, out, "utf8");
|
|
28
32
|
return count;
|
|
29
33
|
}
|
|
30
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Stream a JSONL file row-by-row without loading it whole. Blank lines are skipped.
|
|
36
|
+
*/
|
|
31
37
|
export async function* iterateJSONL(path) {
|
|
32
38
|
for await (const line of TextSpliterator.fromAsync(path)) {
|
|
33
39
|
if (!line.trim())
|
package/out/utils/jsonl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../utils/jsonl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C
|
|
1
|
+
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../utils/jsonl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;GAEG;AACH,MAAM,UAAU,SAAS,CAAI,IAAY;IACxC,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;SAC/B,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC,CAAA;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAAuB;IAC/D,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,GAAG,GAAG,EAAE,CAAA;IAEZ,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;QAEjC,KAAK,EAAE,CAAA;IACR,CAAC;IAED,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;IAEhC,OAAO,KAAK,CAAA;AACb,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAI,IAAY;IAClD,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1D,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,SAAQ;QAC1B,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAA;IAC5B,CAAC;AACF,CAAC"}
|
|
@@ -25,10 +25,14 @@
|
|
|
25
25
|
* integers vanishingly rarely; the builders that emit coordinates accept this edge.
|
|
26
26
|
*/
|
|
27
27
|
export interface PyJSONOptions {
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Escape non-ASCII as `\uXXXX` (Python `ensure_ascii`). Defaults to `true`, matching Python.
|
|
30
|
+
*/
|
|
29
31
|
ensureAscii?: boolean;
|
|
30
32
|
}
|
|
31
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* `json.dumps(value)` — single line, `(", ", ": ")` separators, `ensure_ascii` per options.
|
|
35
|
+
*/
|
|
32
36
|
export declare function pyJSONDumps(value: unknown, options?: PyJSONOptions): string;
|
|
33
37
|
/**
|
|
34
38
|
* Render a string->number map the way Python prints `dict(...)` / `dict(Counter(...))` — single-quoted keys, `, ` / `:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-json.d.ts","sourceRoot":"","sources":["../../utils/python-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,WAAW,aAAa;IAC7B
|
|
1
|
+
{"version":3,"file":"python-json.d.ts","sourceRoot":"","sources":["../../utils/python-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACrB;AA8DD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAE/E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAQ/E"}
|
package/out/utils/python-json.js
CHANGED
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
* serializes as `5`, whereas Python's `float(5.0)` -> `"5.0"`. Real-world lat/lon land on exact
|
|
25
25
|
* integers vanishingly rarely; the builders that emit coordinates accept this edge.
|
|
26
26
|
*/
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Serialize one string the way Python's json does (then optionally `ensure_ascii`-escape it).
|
|
29
|
+
*/
|
|
28
30
|
function serializeString(value, ensureAscii) {
|
|
29
31
|
// JSON.stringify handles the quote/backslash/control escaping identically to Python's json.
|
|
30
32
|
const out = JSON.stringify(value);
|
|
@@ -39,7 +41,9 @@ function serializeString(value, ensureAscii) {
|
|
|
39
41
|
}
|
|
40
42
|
return escaped;
|
|
41
43
|
}
|
|
42
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Serialize one finite/non-finite number the way Python's json does.
|
|
46
|
+
*/
|
|
43
47
|
function serializeNumber(value) {
|
|
44
48
|
if (Number.isFinite(value))
|
|
45
49
|
return JSON.stringify(value);
|
|
@@ -72,7 +76,9 @@ function serialize(value, ensureAscii) {
|
|
|
72
76
|
}
|
|
73
77
|
throw new TypeError(`pyJSONDumps: unsupported value of type ${t}`);
|
|
74
78
|
}
|
|
75
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* `json.dumps(value)` — single line, `(", ", ": ")` separators, `ensure_ascii` per options.
|
|
81
|
+
*/
|
|
76
82
|
export function pyJSONDumps(value, options = {}) {
|
|
77
83
|
return serialize(value, options.ensureAscii ?? true);
|
|
78
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-json.js","sourceRoot":"","sources":["../../utils/python-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;
|
|
1
|
+
{"version":3,"file":"python-json.js","sourceRoot":"","sources":["../../utils/python-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH;;GAEG;AACH,SAAS,eAAe,CAAC,KAAa,EAAE,WAAoB;IAC3D,4FAA4F;IAC5F,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAEjC,IAAI,CAAC,WAAW;QAAE,OAAO,GAAG,CAAA;IAC5B,6FAA6F;IAC7F,4DAA4D;IAC5D,IAAI,OAAO,GAAG,EAAE,CAAA;IAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC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C,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;YACvE,IAAI,CAAC,KAAK,SAAS;gBAAE,SAAQ,CAAC,yCAAyC;YACvE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAA;QAC/E,CAAC;QAED,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpC,CAAC;IAED,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,EAAE,CAAC,CAAA;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc,EAAE,UAAyB,EAAE;IACtE,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC,CAAA;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAA4C;IACtE,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC3B,CAAC;IAED,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;AACpC,CAAC"}
|
|
@@ -14,17 +14,27 @@
|
|
|
14
14
|
* seeded, deterministic-per-input stream and Python's helper semantics — inclusive `randint`,
|
|
15
15
|
* uniform `choice`, with-replacement `choices`.
|
|
16
16
|
*/
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Seeded `random.Random`-equivalent. Backed by mulberry32 (a 32-bit stateful generator).
|
|
19
|
+
*/
|
|
18
20
|
export declare class SeededRandom {
|
|
19
21
|
#private;
|
|
20
22
|
constructor(seed: number);
|
|
21
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Float in `[0, 1)`. Mirrors Python `random.random()`.
|
|
25
|
+
*/
|
|
22
26
|
random(): number;
|
|
23
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Integer in `[lo, hi]` inclusive. Mirrors Python `random.randint(lo, hi)`.
|
|
29
|
+
*/
|
|
24
30
|
randint(lo: number, hi: number): number;
|
|
25
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* One uniformly-chosen element. Mirrors Python `random.choice(seq)`.
|
|
33
|
+
*/
|
|
26
34
|
choice<T>(seq: readonly T[]): T;
|
|
27
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* `k` elements chosen with replacement. Mirrors Python `random.choices(seq, k=k)`.
|
|
37
|
+
*/
|
|
28
38
|
choices<T>(seq: readonly T[], k: number): T[];
|
|
29
39
|
/**
|
|
30
40
|
* In-place Fisher-Yates shuffle. Mirrors Python `random.shuffle(x)` — distribution-correct, but NOT bit-identical to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-random.d.ts","sourceRoot":"","sources":["../../utils/python-random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH
|
|
1
|
+
{"version":3,"file":"python-random.d.ts","sourceRoot":"","sources":["../../utils/python-random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,qBAAa,YAAY;;gBAGZ,IAAI,EAAE,MAAM;IAKxB;;OAEG;IACH,MAAM,IAAI,MAAM;IAQhB;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACH,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC;IAI/B;;OAEG;IACH,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE;IAU7C;;;OAGG;IACH,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI;IAS1B;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE;CAe5C"}
|
|
@@ -14,29 +14,39 @@
|
|
|
14
14
|
* seeded, deterministic-per-input stream and Python's helper semantics — inclusive `randint`,
|
|
15
15
|
* uniform `choice`, with-replacement `choices`.
|
|
16
16
|
*/
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Seeded `random.Random`-equivalent. Backed by mulberry32 (a 32-bit stateful generator).
|
|
19
|
+
*/
|
|
18
20
|
export class SeededRandom {
|
|
19
21
|
#state;
|
|
20
22
|
constructor(seed) {
|
|
21
23
|
// mulberry32 wants a non-zero 32-bit state.
|
|
22
24
|
this.#state = seed >>> 0 || 1;
|
|
23
25
|
}
|
|
24
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Float in `[0, 1)`. Mirrors Python `random.random()`.
|
|
28
|
+
*/
|
|
25
29
|
random() {
|
|
26
|
-
let t = (this.#state +=
|
|
30
|
+
let t = (this.#state += 0x6d_2b_79_f5);
|
|
27
31
|
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
28
32
|
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
29
|
-
return ((t ^ (t >>> 14)) >>> 0) /
|
|
33
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4_294_967_296;
|
|
30
34
|
}
|
|
31
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Integer in `[lo, hi]` inclusive. Mirrors Python `random.randint(lo, hi)`.
|
|
37
|
+
*/
|
|
32
38
|
randint(lo, hi) {
|
|
33
39
|
return lo + Math.floor(this.random() * (hi - lo + 1));
|
|
34
40
|
}
|
|
35
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* One uniformly-chosen element. Mirrors Python `random.choice(seq)`.
|
|
43
|
+
*/
|
|
36
44
|
choice(seq) {
|
|
37
45
|
return seq[Math.floor(this.random() * seq.length)];
|
|
38
46
|
}
|
|
39
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* `k` elements chosen with replacement. Mirrors Python `random.choices(seq, k=k)`.
|
|
49
|
+
*/
|
|
40
50
|
choices(seq, k) {
|
|
41
51
|
const out = [];
|
|
42
52
|
for (let i = 0; i < k; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-random.js","sourceRoot":"","sources":["../../utils/python-random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH
|
|
1
|
+
{"version":3,"file":"python-random.js","sourceRoot":"","sources":["../../utils/python-random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,MAAM,OAAO,YAAY;IACxB,MAAM,CAAQ;IAEd,YAAY,IAAY;QACvB,4CAA4C;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM;QACL,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,aAAa,CAAC,CAAA;QACtC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;QACpC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;QAEzC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,aAAa,CAAA;IAChD,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,EAAU,EAAE,EAAU;QAC7B,OAAO,EA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,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAA;YACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAE,CAAA;YAClB,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;YACb,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAA;QACnB,CAAC;QAED,OAAO,GAAG,CAAA;IACX,CAAC;CACD"}
|
package/out/utils/repo.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export declare const repoRootPathBuilder: import("path-ts").PathBuilderResolver<
|
|
|
25
25
|
* for handing paths straight to `node:fs` and other string APIs without a `.toString()`.
|
|
26
26
|
*/
|
|
27
27
|
export declare const repoRootPath: import("path-ts").PathResolver<"mailwoman">;
|
|
28
|
+
/**
|
|
29
|
+
* Path builder rooted at `@mailwoman/core`, so data under `core/data/` resolves the same in source and compiled trees.
|
|
30
|
+
* See the `__isCompiledTree` note in this file before reaching across that boundary.
|
|
31
|
+
*/
|
|
28
32
|
export declare const corePackagePathBuilder: import("path-ts").PathBuilderResolver<"mailwoman">;
|
|
29
33
|
/**
|
|
30
34
|
* Absolute-path-string resolver relative to the `@mailwoman/core` workspace root — the string-returning sibling of
|
package/out/utils/repo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../utils/repo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAiD,KAAK,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;AAEpG;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAQ,CAAA;
|
|
1
|
+
{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|
package/out/utils/repo.js
CHANGED
|
@@ -55,6 +55,10 @@ export const repoRootPath = createPathResolver(RepoRootAbsolutePath);
|
|
|
55
55
|
* the JS without any post-install copy step.
|
|
56
56
|
*/
|
|
57
57
|
const CorePackageAbsolutePath = resolve(__dirname, "..", __isCompiledTree ? ".." : "");
|
|
58
|
+
/**
|
|
59
|
+
* Path builder rooted at `@mailwoman/core`, so data under `core/data/` resolves the same in source and compiled trees.
|
|
60
|
+
* See the `__isCompiledTree` note in this file before reaching across that boundary.
|
|
61
|
+
*/
|
|
58
62
|
export const corePackagePathBuilder = createPathBuilderResolver(CorePackageAbsolutePath);
|
|
59
63
|
/**
|
|
60
64
|
* Absolute-path-string resolver relative to the `@mailwoman/core` workspace root — the string-returning sibling of
|
package/out/utils/repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../utils/repo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAA+B,MAAM,SAAS,CAAA;AAEpG;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../utils/repo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAA+B,MAAM,SAAS,CAAA;AAEpG;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAI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AgB,EAAE,GAAG,YAAY,CAAQ,CAAA;AACrE,CAAC;AAID;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC5C,QAAW,EACX,GAAG,YAAe;IAElB,OAAO,sBAAsB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,YAAY,CAAC,CAAA;AACjF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAgD,QAAW,EAAE,GAAG,YAAe;IACpH,OAAO,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,YAAY,CAAC,CAAA;AAC1E,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA"}
|
package/out/utils/sealed-db.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { DatabaseSync } from "node:sqlite";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* A write-mode open was attempted on a sealed (0444) data artifact.
|
|
4
|
+
*/
|
|
3
5
|
export declare class SealedArtifactError extends Error {
|
|
4
6
|
constructor(path: string);
|
|
5
7
|
}
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* True when the artifact exists and carries no write bits (the sealed state {@link sealDatabase} leaves).
|
|
10
|
+
*/
|
|
7
11
|
export declare function isSealed(path: string): boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Finalize a built DB: WAL-checkpoint → `journal_mode = DELETE` → remove `-wal`/`-shm` sidecars → `chmod 0o444`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-db.d.ts","sourceRoot":"","sources":["../../utils/sealed-db.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAY/C
|
|
1
|
+
{"version":3,"file":"sealed-db.d.ts","sourceRoot":"","sources":["../../utils/sealed-db.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAY/C;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBACjC,IAAI,EAAE,MAAM;CAQxB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CA4B/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,YAAY,CAQ5F"}
|
package/out/utils/sealed-db.js
CHANGED
|
@@ -20,7 +20,9 @@ import { basename } from "node:path";
|
|
|
20
20
|
function sqlite() {
|
|
21
21
|
return process.getBuiltinModule("node:sqlite");
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* A write-mode open was attempted on a sealed (0444) data artifact.
|
|
25
|
+
*/
|
|
24
26
|
export class SealedArtifactError extends Error {
|
|
25
27
|
constructor(path) {
|
|
26
28
|
super(`${basename(path)} is a sealed read-only artifact — rebuild it via \`mailwoman gazetteer build …\`, ` +
|
|
@@ -28,7 +30,9 @@ export class SealedArtifactError extends Error {
|
|
|
28
30
|
this.name = "SealedArtifactError";
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* True when the artifact exists and carries no write bits (the sealed state {@link sealDatabase} leaves).
|
|
35
|
+
*/
|
|
32
36
|
export function isSealed(path) {
|
|
33
37
|
return existsSync(path) && (statSync(path).mode & 0o222) === 0;
|
|
34
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-db.js","sourceRoot":"","sources":["../../utils/sealed-db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAA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
|
|
|
10
10
|
* (oa-resolver-eval.ts / resolver-eval.ts) — gate parity depends on this exact semantics; do not
|
|
11
11
|
* "upgrade" it to linear interpolation.
|
|
12
12
|
*/
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Nearest-rank percentile over an unsorted sample; `null` on an empty sample. `p` in [0, 100].
|
|
15
|
+
*/
|
|
14
16
|
export declare function percentile(xs: readonly number[], p: number): number | null;
|
|
15
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* `percentile(xs, 50)`.
|
|
19
|
+
*/
|
|
16
20
|
export declare function median(xs: readonly number[]): number | null;
|
|
17
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Format `numerator / denominator` as a fixed-digit percentage (`"12.5%"`); `"—"` when `denominator` is 0.
|
|
23
|
+
*/
|
|
18
24
|
export declare function formatPercent(numerator: number, denominator: number, digits?: number): string;
|
|
19
25
|
//# sourceMappingURL=stats.d.ts.map
|
package/out/utils/stats.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,MAAM,CAIxF"}
|
package/out/utils/stats.js
CHANGED
|
@@ -10,18 +10,24 @@
|
|
|
10
10
|
* (oa-resolver-eval.ts / resolver-eval.ts) — gate parity depends on this exact semantics; do not
|
|
11
11
|
* "upgrade" it to linear interpolation.
|
|
12
12
|
*/
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Nearest-rank percentile over an unsorted sample; `null` on an empty sample. `p` in [0, 100].
|
|
15
|
+
*/
|
|
14
16
|
export function percentile(xs, p) {
|
|
15
|
-
if (xs.length
|
|
17
|
+
if (!xs.length)
|
|
16
18
|
return null;
|
|
17
|
-
const s = [...xs].
|
|
19
|
+
const s = [...xs].toSorted((a, b) => a - b);
|
|
18
20
|
return s[Math.min(s.length - 1, Math.floor((p / 100) * s.length))];
|
|
19
21
|
}
|
|
20
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* `percentile(xs, 50)`.
|
|
24
|
+
*/
|
|
21
25
|
export function median(xs) {
|
|
22
26
|
return percentile(xs, 50);
|
|
23
27
|
}
|
|
24
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Format `numerator / denominator` as a fixed-digit percentage (`"12.5%"`); `"—"` when `denominator` is 0.
|
|
30
|
+
*/
|
|
25
31
|
export function formatPercent(numerator, denominator, digits = 1) {
|
|
26
32
|
if (denominator === 0)
|
|
27
33
|
return "—";
|
package/out/utils/stats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EAAqB,EAAE,CAAS;IAC1D,IAAI,CAAC,EAAE,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAC3B,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAE3C,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,CAAA;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,EAAqB;IAC3C,OAAO,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB,EAAE,WAAmB,EAAE,MAAM,GAAG,CAAC;IAC/E,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,GAAG,CAAA;IAEjC,OAAO,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;AAC/D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Mailwoman core: tokenization, decoder, formatter, resources, filters, utils.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
},
|
|
289
289
|
"devDependencies": {
|
|
290
290
|
"@duckdb/node-api": "1.5.3-r.3",
|
|
291
|
-
"@mailwoman/codex": "8.
|
|
291
|
+
"@mailwoman/codex": "8.3.0",
|
|
292
292
|
"@types/d3-color": "^3.1.3",
|
|
293
293
|
"@types/d3-scale-chromatic": "^3.1.0"
|
|
294
294
|
}
|
package/pipeline/index.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export { reconcileSpans } from "./reconcile.ts"
|
|
10
|
+
|
|
10
11
|
export type {
|
|
11
12
|
ClassifierCandidate,
|
|
12
13
|
ParentChainLookup,
|
|
@@ -16,16 +17,19 @@ export type {
|
|
|
16
17
|
ResolverCandidatesLookup,
|
|
17
18
|
ScoreBreakdown,
|
|
18
19
|
} from "./reconcile.ts"
|
|
20
|
+
|
|
19
21
|
export { HARD_PLACE_COUNTRY_SAFELIST, hardCountryFor, isBareLocalityTree, runPipeline } from "./runtime-pipeline.ts"
|
|
20
22
|
export { aggregateSpanLogits } from "./span-logit-aggregation.ts"
|
|
21
23
|
export type { SpanBounds, TokenPiece } from "./span-logit-aggregation.ts"
|
|
22
24
|
export { EMPTY_SPAN_PROPOSER_LEXICON, proposeSpans } from "./span-proposer.ts"
|
|
23
25
|
export type { ProposedSpan, ProposedSpanKind, SpanProposerLexicon } from "./span-proposer.ts"
|
|
24
|
-
export { WORD_CONSISTENCY_SHIP_DEFAULT } from "./types.ts"
|
|
26
|
+
export { deriveInputMode, WORD_CONSISTENCY_SHIP_DEFAULT } from "./types.ts"
|
|
27
|
+
|
|
25
28
|
export type {
|
|
26
29
|
AddressClassifier,
|
|
27
30
|
ClassifierOpts,
|
|
28
31
|
FSTMatcherLike,
|
|
32
|
+
InputMode,
|
|
29
33
|
LocaleHint,
|
|
30
34
|
LocaleTag,
|
|
31
35
|
NormalizedInputLite,
|
|
@@ -61,6 +61,7 @@ export async function prefetchReconcileLookups(
|
|
|
61
61
|
const text = raw.slice(candidate.span.start, candidate.span.end).trim()
|
|
62
62
|
|
|
63
63
|
if (!text) continue
|
|
64
|
+
|
|
64
65
|
budget--
|
|
65
66
|
let places: ResolvedPlace[] = []
|
|
66
67
|
|
|
@@ -75,6 +76,7 @@ export async function prefetchReconcileLookups(
|
|
|
75
76
|
// A backend failure degrades to "no concordance evidence for this pair" — the
|
|
76
77
|
// reconciler scores without it, identical to today's behavior.
|
|
77
78
|
}
|
|
79
|
+
|
|
78
80
|
candidateTable.set(key, places.slice(0, perPair))
|
|
79
81
|
|
|
80
82
|
// Ancestors are synchronous + memoized backend-side; chain them now so parentsOf is a
|
|
@@ -83,6 +85,7 @@ export async function prefetchReconcileLookups(
|
|
|
83
85
|
for (const place of places) {
|
|
84
86
|
if (chainTable.has(place.id)) continue
|
|
85
87
|
const chain = backend.ancestors(place.id) ?? []
|
|
88
|
+
|
|
86
89
|
// The reconciler's concordance check is MEMBERSHIP-ONLY (by id) — Ancestor carries no
|
|
87
90
|
// coordinates, and none are needed; zeroes satisfy the ResolvedPlace shape.
|
|
88
91
|
chainTable.set(
|