@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
|
@@ -30,6 +30,11 @@ import { dataRootPath } from "../../utils/data-root.ts"
|
|
|
30
30
|
import { repoRootPath } from "../../utils/repo.ts"
|
|
31
31
|
import { hashFNV1a } from "./fnv-hash.ts"
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Shortest raw string worth keeping as an outlier example; below it there is nothing to learn from.
|
|
35
|
+
*/
|
|
36
|
+
const MIN_OUTLIER_LENGTH = 6
|
|
37
|
+
|
|
33
38
|
interface LatinTestRow {
|
|
34
39
|
raw: string
|
|
35
40
|
country: string
|
|
@@ -37,36 +42,48 @@ interface LatinTestRow {
|
|
|
37
42
|
srcCountry: string
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Options for {@linkcode buildOutlierLatin}.
|
|
47
|
+
*/
|
|
41
48
|
export interface BuildOutlierLatinOptions {
|
|
42
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Rows sampled per off-map country. Default 6000.
|
|
51
|
+
*/
|
|
43
52
|
perCountry?: number
|
|
44
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Overture release dir. Default `$MAILWOMAN_DATA_ROOT/overture/2026-05-20.0`.
|
|
55
|
+
*/
|
|
45
56
|
overture?: string
|
|
46
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Dataset dir the OTHER rows append to. Default `<repo>/data/coarse-placer`.
|
|
59
|
+
*/
|
|
47
60
|
data?: string
|
|
48
61
|
}
|
|
49
62
|
|
|
50
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Result of {@linkcode buildOutlierLatin}.
|
|
65
|
+
*/
|
|
51
66
|
export interface BuildOutlierLatinResult {
|
|
52
67
|
train: number
|
|
53
68
|
val: number
|
|
54
69
|
test: number
|
|
55
70
|
}
|
|
56
71
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Off-map (NOT among the trained countries) and Latin-script. TRAIN feeds the OTHER class; HELDOUT is test-only — the
|
|
74
|
+
* generalization probe (unseen off-map countries should still route OTHER). #743: PL/PT/CZ moved from OTHER to
|
|
75
|
+
* FIRST-CLASS in-map countries (they're now in COARSE_CLASSES), so they're removed here — keeping them would feed
|
|
76
|
+
* contradictory gold (the same address labelled both PL and OTHER). That leaves BR/MX as the Latin off-map TRAIN
|
|
77
|
+
* exposure and CA/LI as the heldout probe (the hard near-twins of in-map US/DE — an honest worst case). The in-map
|
|
78
|
+
* expansion itself shrinks the off-map Latin surface, and the bulk OTHER exposure is non-Latin (build-
|
|
79
|
+
* outlier-exposure.ts), so the thinner Latin train set is acceptable; watch OTHER-Latin recall in the openset eval.
|
|
80
|
+
*/
|
|
66
81
|
const TRAIN_COUNTRIES = ["BR", "MX"]
|
|
67
82
|
const HELDOUT_COUNTRIES = ["CA", "LI"]
|
|
68
83
|
|
|
69
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Address_levels arrives as a list (node-api) or its string repr; pull the value strings out.
|
|
86
|
+
*/
|
|
70
87
|
function levelValues(al: unknown): string[] {
|
|
71
88
|
if (Array.isArray(al)) return al.map((x) => (x && x.value ? String(x.value) : "")).filter(Boolean)
|
|
72
89
|
const s = String(al ?? "")
|
|
@@ -85,13 +102,15 @@ function levelValues(al: unknown): string[] {
|
|
|
85
102
|
return out
|
|
86
103
|
}
|
|
87
104
|
|
|
88
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Assemble a plausible address string from an Overture address row. Deterministic variant by hash.
|
|
107
|
+
*/
|
|
89
108
|
function assemble(r: Record<string, unknown>): string | null {
|
|
90
109
|
const num = (r.number ?? "").toString().trim()
|
|
91
110
|
const street = (r.street ?? "").toString().trim()
|
|
92
111
|
const pc = (r.postcode ?? "").toString().trim()
|
|
93
112
|
const levels = levelValues(r.address_levels)
|
|
94
|
-
const locality = (r.postal_city ? String(r.postal_city) : "") || levels
|
|
113
|
+
const locality = (r.postal_city ? String(r.postal_city) : "") || levels.at(-1) || levels[0] || ""
|
|
95
114
|
|
|
96
115
|
if (!street && !locality) return null // nothing distinctive
|
|
97
116
|
const head = [num, street].filter(Boolean).join(" ")
|
|
@@ -108,7 +127,9 @@ function assemble(r: Record<string, unknown>): string | null {
|
|
|
108
127
|
}
|
|
109
128
|
}
|
|
110
129
|
|
|
111
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Coarse-placer Overture Latin-off-map outlier builder — see the module doc.
|
|
132
|
+
*/
|
|
112
133
|
export async function buildOutlierLatin(
|
|
113
134
|
options: BuildOutlierLatinOptions = {},
|
|
114
135
|
report?: (line: string) => void
|
|
@@ -129,18 +150,19 @@ export async function buildOutlierLatin(
|
|
|
129
150
|
res = await duck.runAndReadAll(
|
|
130
151
|
`SELECT number, street, postcode, postal_city, address_levels FROM read_parquet('${f}') LIMIT ${PER}`
|
|
131
152
|
)
|
|
132
|
-
} catch (
|
|
133
|
-
report?.(` ${cc}: SKIP (${(
|
|
153
|
+
} catch (error) {
|
|
154
|
+
report?.(` ${cc}: SKIP (${(error as Error).message.split("\n")[0]})`)
|
|
134
155
|
|
|
135
156
|
return []
|
|
136
157
|
}
|
|
158
|
+
|
|
137
159
|
const seen = new Set<string>()
|
|
138
160
|
const out: string[] = []
|
|
139
161
|
|
|
140
162
|
for (const r of res.getRowObjects()) {
|
|
141
163
|
const raw = assemble(r)
|
|
142
164
|
|
|
143
|
-
if (!raw || seen.has(raw) || raw.length <
|
|
165
|
+
if (!raw || seen.has(raw) || raw.length < MIN_OUTLIER_LENGTH) continue
|
|
144
166
|
seen.add(raw)
|
|
145
167
|
out.push(raw)
|
|
146
168
|
}
|
|
@@ -155,7 +177,7 @@ export async function buildOutlierLatin(
|
|
|
155
177
|
// dedicated Latin off-map test: {raw, country:"OTHER", group, srcCountry}
|
|
156
178
|
|
|
157
179
|
for (const cc of TRAIN_COUNTRIES) {
|
|
158
|
-
const rows = (await rowsFor(cc)).
|
|
180
|
+
const rows = (await rowsFor(cc)).toSorted((a, b) => hashFNV1a(a) - hashFNV1a(b))
|
|
159
181
|
const nVal = Math.floor(rows.length * 0.1)
|
|
160
182
|
const nTest = Math.floor(rows.length * 0.1)
|
|
161
183
|
const val = rows.slice(0, nVal)
|
|
@@ -173,6 +195,7 @@ export async function buildOutlierLatin(
|
|
|
173
195
|
for (const raw of test) {
|
|
174
196
|
testRows.push({ raw, country: "OTHER", group: "indist", srcCountry: cc })
|
|
175
197
|
}
|
|
198
|
+
|
|
176
199
|
report?.(` TRAIN ${cc}: ${rows.length} (train ${train.length} / val ${val.length} / test ${test.length})`)
|
|
177
200
|
}
|
|
178
201
|
|
|
@@ -182,8 +205,10 @@ export async function buildOutlierLatin(
|
|
|
182
205
|
for (const raw of rows) {
|
|
183
206
|
testRows.push({ raw, country: "OTHER", group: "heldout", srcCountry: cc })
|
|
184
207
|
}
|
|
208
|
+
|
|
185
209
|
report?.(` HELDOUT ${cc}: ${rows.length} (test-only)`)
|
|
186
210
|
}
|
|
211
|
+
|
|
187
212
|
;(duck as { disconnect?: () => void }).disconnect?.()
|
|
188
213
|
|
|
189
214
|
// Append OTHER rows to train/val; write the dedicated Latin off-map test file.
|
|
@@ -192,6 +217,7 @@ export async function buildOutlierLatin(
|
|
|
192
217
|
appendFileSync(path.join(dataDir, "val.jsonl"), wr(valAppend))
|
|
193
218
|
writeFileSync(path.join(dataDir, "test-latin-offmap.jsonl"), testRows.map((r) => JSON.stringify(r)).join("\n") + "\n")
|
|
194
219
|
report?.(`\nappended OTHER → train +${trainAppend.length}, val +${valAppend.length}`)
|
|
220
|
+
|
|
195
221
|
report?.(
|
|
196
222
|
`wrote test-latin-offmap.jsonl: ${testRows.length} rows (indist ${testRows.filter((r) => r.group === "indist").length} / heldout ${testRows.filter((r) => r.group === "heldout").length})`
|
|
197
223
|
)
|
|
@@ -36,6 +36,11 @@ import { dataRootPath } from "../../utils/data-root.ts"
|
|
|
36
36
|
import { repoRootPath } from "../../utils/repo.ts"
|
|
37
37
|
import { hashFNV1a } from "./fnv-hash.ts"
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Shortest raw string worth keeping as an outlier example; below it there is nothing to learn from.
|
|
41
|
+
*/
|
|
42
|
+
const MIN_OUTLIER_LENGTH = 6
|
|
43
|
+
|
|
39
44
|
interface OaTestRow {
|
|
40
45
|
raw: string
|
|
41
46
|
country: string
|
|
@@ -44,17 +49,27 @@ interface OaTestRow {
|
|
|
44
49
|
family: string
|
|
45
50
|
}
|
|
46
51
|
|
|
47
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Options for {@linkcode buildOutlierOA}.
|
|
54
|
+
*/
|
|
48
55
|
export interface BuildOutlierOAOptions {
|
|
49
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Extracted OpenAddresses root. Default `$MAILWOMAN_DATA_ROOT/openaddresses/extracted`.
|
|
58
|
+
*/
|
|
50
59
|
oaDir?: string
|
|
51
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Row cap per off-map country. Default 6000.
|
|
62
|
+
*/
|
|
52
63
|
perCountry?: number
|
|
53
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Dataset dir the OTHER rows append to. Default `<repo>/data/coarse-placer`.
|
|
66
|
+
*/
|
|
54
67
|
data?: string
|
|
55
68
|
}
|
|
56
69
|
|
|
57
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Result of {@linkcode buildOutlierOA}.
|
|
72
|
+
*/
|
|
58
73
|
export interface BuildOutlierOAResult {
|
|
59
74
|
train: number
|
|
60
75
|
val: number
|
|
@@ -63,14 +78,18 @@ export interface BuildOutlierOAResult {
|
|
|
63
78
|
heldoutCountries: number
|
|
64
79
|
}
|
|
65
80
|
|
|
66
|
-
|
|
81
|
+
/**
|
|
82
|
+
* The 11 IN-MAP countries the coarse-placer routes to — never appear in OTHER. (build-dataset.ts)
|
|
83
|
+
*/
|
|
67
84
|
const IN_MAP = new Set(["US", "FR", "GB", "CN", "NL", "IT", "DE", "JP", "ES", "KR", "TW"])
|
|
68
85
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Language/region families for the leave-one-family-out split. Off-map countries OA's europe+asia zips plausibly carry;
|
|
88
|
+
* the actual TRAIN/HELDOUT set is intersected with what's on disk at runtime. HELDOUT families are the generalization
|
|
89
|
+
* probe (the model never sees a single row from them). Off-map families, intersected at runtime with what OA's
|
|
90
|
+
* europe+asia zips actually carry (verified on disk: ae at au be cz dk ee fi gr il is kw kz lt lu lv nc nz pl pt qa ro
|
|
91
|
+
* sa se sg si sk).
|
|
92
|
+
*/
|
|
74
93
|
const FAMILIES: Record<string, string[]> = {
|
|
75
94
|
slavic_latin: ["PL", "CZ", "SK", "SI"],
|
|
76
95
|
romance_offmap: ["PT", "RO"],
|
|
@@ -83,11 +102,16 @@ const FAMILIES: Record<string, string[]> = {
|
|
|
83
102
|
oceania: ["AU", "NZ", "NC"],
|
|
84
103
|
middle_east: ["AE", "IL", "KW", "QA", "SA"],
|
|
85
104
|
}
|
|
86
|
-
|
|
87
|
-
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Leave-one-language-FAMILY-out probe (DeepSeek): hold out WHOLE families the model never sees a row from — Baltic
|
|
108
|
+
* (Latin, distinct), Oceania (English-Latin, distinct), Middle-East (romanized non-Latin).
|
|
109
|
+
*/
|
|
88
110
|
const HELDOUT_FAMILIES = new Set(["baltic", "oceania", "middle_east"])
|
|
89
111
|
|
|
90
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Assemble a plausible address string from an OA row — SAME shape variants as build-outlier-latin.
|
|
114
|
+
*/
|
|
91
115
|
function assemble(r: Record<string, unknown>): string | null {
|
|
92
116
|
const num = (r.number ?? "").toString().trim()
|
|
93
117
|
const street = (r.street ?? "").toString().trim()
|
|
@@ -112,7 +136,9 @@ function assemble(r: Record<string, unknown>): string | null {
|
|
|
112
136
|
}
|
|
113
137
|
}
|
|
114
138
|
|
|
115
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Coarse-placer OpenAddresses Latin-off-map outlier builder — see the module doc.
|
|
141
|
+
*/
|
|
116
142
|
export async function buildOutlierOA(
|
|
117
143
|
options: BuildOutlierOAOptions = {},
|
|
118
144
|
report?: (line: string) => void
|
|
@@ -141,11 +167,12 @@ export async function buildOutlierOA(
|
|
|
141
167
|
// number both resolve. Pull a generous superset, dedup+cap in JS.
|
|
142
168
|
`SELECT COLUMNS('(?i)^(number|street|city|postcode)$') FROM read_csv_auto('${glob}', union_by_name=true, ignore_errors=true, sample_size=-1) LIMIT ${PER * 8}`
|
|
143
169
|
)
|
|
144
|
-
} catch (
|
|
145
|
-
report?.(` ${cc}: SKIP (${(
|
|
170
|
+
} catch (error) {
|
|
171
|
+
report?.(` ${cc}: SKIP (${(error as Error).message.split("\n")[0]})`)
|
|
146
172
|
|
|
147
173
|
return []
|
|
148
174
|
}
|
|
175
|
+
|
|
149
176
|
const seen = new Set<string>()
|
|
150
177
|
const out: string[] = []
|
|
151
178
|
|
|
@@ -156,16 +183,17 @@ export async function buildOutlierOA(
|
|
|
156
183
|
for (const [k, v] of Object.entries(r)) {
|
|
157
184
|
row[k.toLowerCase()] = v
|
|
158
185
|
}
|
|
186
|
+
|
|
159
187
|
const raw = assemble(row)
|
|
160
188
|
|
|
161
|
-
if (!raw || raw.length <
|
|
189
|
+
if (!raw || raw.length < MIN_OUTLIER_LENGTH || seen.has(raw)) continue
|
|
162
190
|
seen.add(raw)
|
|
163
191
|
out.push(raw)
|
|
164
192
|
|
|
165
193
|
if (out.length >= PER) break
|
|
166
194
|
}
|
|
167
195
|
|
|
168
|
-
return out.
|
|
196
|
+
return out.toSorted((a, b) => hashFNV1a(a) - hashFNV1a(b))
|
|
169
197
|
}
|
|
170
198
|
|
|
171
199
|
const trainAppend: string[] = []
|
|
@@ -181,12 +209,13 @@ export async function buildOutlierOA(
|
|
|
181
209
|
if (IN_MAP.has(cc)) continue
|
|
182
210
|
const rows = await rowsFor(cc)
|
|
183
211
|
|
|
184
|
-
if (rows.length
|
|
212
|
+
if (!rows.length) continue
|
|
185
213
|
|
|
186
214
|
if (heldout) {
|
|
187
215
|
for (const raw of rows) {
|
|
188
216
|
testRows.push({ raw, country: "OTHER", group: "heldout", srcCountry: cc, family })
|
|
189
217
|
}
|
|
218
|
+
|
|
190
219
|
heldCC++
|
|
191
220
|
report?.(` HELDOUT ${cc} (${family}): ${rows.length} (test-only)`)
|
|
192
221
|
} else {
|
|
@@ -204,11 +233,13 @@ export async function buildOutlierOA(
|
|
|
204
233
|
for (const raw of rows.slice(nVal + nTest)) {
|
|
205
234
|
trainAppend.push(raw)
|
|
206
235
|
}
|
|
236
|
+
|
|
207
237
|
trainCC++
|
|
208
238
|
report?.(` TRAIN ${cc} (${family}): ${rows.length}`)
|
|
209
239
|
}
|
|
210
240
|
}
|
|
211
241
|
}
|
|
242
|
+
|
|
212
243
|
;(duck as { disconnect?: () => void }).disconnect?.()
|
|
213
244
|
|
|
214
245
|
const wr = (rows: string[]): string => rows.map((raw) => JSON.stringify({ raw, country: "OTHER" })).join("\n") + "\n"
|
|
@@ -217,6 +248,7 @@ export async function buildOutlierOA(
|
|
|
217
248
|
writeFileSync(path.join(dataDir, "test-latin-offmap.jsonl"), testRows.map((r) => JSON.stringify(r)).join("\n") + "\n")
|
|
218
249
|
report?.(`\nTRAIN countries: ${trainCC} · HELDOUT countries: ${heldCC}`)
|
|
219
250
|
report?.(`appended OTHER → train +${trainAppend.length}, val +${valAppend.length}`)
|
|
251
|
+
|
|
220
252
|
report?.(
|
|
221
253
|
`wrote test-latin-offmap.jsonl: ${testRows.length} (indist ${testRows.filter((r) => r.group === "indist").length} / heldout ${testRows.filter((r) => r.group === "heldout").length})`
|
|
222
254
|
)
|
|
@@ -21,6 +21,11 @@ import { repoRootPath } from "../../utils/repo.ts"
|
|
|
21
21
|
import { formatPercent } from "../../utils/stats.ts"
|
|
22
22
|
import { CoarsePlacer, type CoarsePlacerMeta, type CoarsePrediction } from "../coarse-placer.ts"
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Samples a bucket needs before its off-map rate is reported rather than folded into the tail.
|
|
26
|
+
*/
|
|
27
|
+
const MIN_REPORTABLE_SAMPLES = 8
|
|
28
|
+
|
|
24
29
|
interface OffMapRow {
|
|
25
30
|
raw: string
|
|
26
31
|
country: string
|
|
@@ -28,23 +33,35 @@ interface OffMapRow {
|
|
|
28
33
|
srcCountry: string
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Options for {@linkcode evalLatinOffmap}.
|
|
38
|
+
*/
|
|
32
39
|
export interface EvalLatinOffmapOptions {
|
|
33
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Model artifact dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`.
|
|
42
|
+
*/
|
|
34
43
|
model?: string
|
|
35
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Abstention threshold. Default 0.5.
|
|
46
|
+
*/
|
|
36
47
|
abstain?: number
|
|
37
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Dataset dir (`test-latin-offmap.jsonl`). Default `<repo>/data/coarse-placer`.
|
|
50
|
+
*/
|
|
38
51
|
data?: string
|
|
39
52
|
}
|
|
40
53
|
|
|
41
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Result of {@linkcode evalLatinOffmap}.
|
|
56
|
+
*/
|
|
42
57
|
export interface EvalLatinOffmapResult {
|
|
43
58
|
n: number
|
|
44
59
|
handled: number
|
|
45
60
|
}
|
|
46
61
|
|
|
47
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Coarse-placer Latin off-map handling eval — see the module doc. Emits the report to stdout.
|
|
64
|
+
*/
|
|
48
65
|
export async function evalLatinOffmap(options: EvalLatinOffmapOptions = {}): Promise<EvalLatinOffmapResult> {
|
|
49
66
|
const modelDir = options.model || dataRootPath("coarse-placer", "model")
|
|
50
67
|
const abstain = options.abstain ?? 0.5
|
|
@@ -73,6 +90,7 @@ export async function evalLatinOffmap(options: EvalLatinOffmapOptions = {}): Pro
|
|
|
73
90
|
} else {
|
|
74
91
|
weights = new Float32Array(ab)
|
|
75
92
|
}
|
|
93
|
+
|
|
76
94
|
const placer = new CoarsePlacer({ ...meta, weights }, { abstainBelow: abstain })
|
|
77
95
|
|
|
78
96
|
const rows: OffMapRow[] = readFileSync(path.join(dataDir, "test-latin-offmap.jsonl"), "utf8")
|
|
@@ -91,42 +109,49 @@ export async function evalLatinOffmap(options: EvalLatinOffmapOptions = {}): Pro
|
|
|
91
109
|
for (const r of rows) {
|
|
92
110
|
const p = placer.predict(r.raw)
|
|
93
111
|
const h = handled(p)
|
|
112
|
+
|
|
94
113
|
n++
|
|
95
114
|
|
|
96
115
|
if (h) {
|
|
97
116
|
ok++
|
|
98
117
|
}
|
|
118
|
+
|
|
99
119
|
bump(`group:${r.group}`).n++
|
|
120
|
+
|
|
100
121
|
bump(`cc:${r.srcCountry}`).n++
|
|
101
122
|
|
|
102
123
|
if (h) {
|
|
103
124
|
bump(`group:${r.group}`).ok++
|
|
125
|
+
|
|
104
126
|
bump(`cc:${r.srcCountry}`).ok++
|
|
105
127
|
} else {
|
|
106
128
|
missTo[p.country!] = (missTo[p.country!] ?? 0) + 1
|
|
107
129
|
|
|
108
|
-
if (samples.length <
|
|
130
|
+
if (samples.length < MIN_REPORTABLE_SAMPLES) {
|
|
109
131
|
samples.push(` ${r.srcCountry} → ${p.country} @${p.confidence.toFixed(2)} «${r.raw.slice(0, 38)}»`)
|
|
110
132
|
}
|
|
111
133
|
}
|
|
112
134
|
}
|
|
135
|
+
|
|
113
136
|
console.log(`Latin off-map handling — model ${path.basename(modelDir)} (abstain ${abstain}, n=${n})`)
|
|
114
137
|
console.log(` OVERALL handled (OTHER-or-abstain): ${ok}/${n} (${formatPercent(ok, n)}) ← want ≥90%`)
|
|
115
138
|
console.log(` by group:`)
|
|
116
139
|
|
|
117
140
|
for (const k of Object.keys(by)
|
|
118
|
-
.filter((
|
|
119
|
-
.
|
|
141
|
+
.filter((key) => key.startsWith("group:"))
|
|
142
|
+
.toSorted()) {
|
|
120
143
|
console.log(` ${k.slice(6).padEnd(8)} ${formatPercent(by[k]!.ok, by[k]!.n)} (n=${by[k]!.n})`)
|
|
121
144
|
}
|
|
145
|
+
|
|
122
146
|
console.log(` by source country:`)
|
|
123
147
|
|
|
124
148
|
for (const k of Object.keys(by)
|
|
125
|
-
.filter((
|
|
126
|
-
.
|
|
149
|
+
.filter((key) => key.startsWith("cc:"))
|
|
150
|
+
.toSorted()) {
|
|
127
151
|
console.log(` ${k.slice(3).padEnd(4)} ${formatPercent(by[k]!.ok, by[k]!.n)} (n=${by[k]!.n})`)
|
|
128
152
|
}
|
|
129
|
-
|
|
153
|
+
|
|
154
|
+
const misses = Object.entries(missTo).toSorted((a, b) => b[1] - a[1])
|
|
130
155
|
|
|
131
156
|
if (misses.length) {
|
|
132
157
|
console.log(` misses land on: ${misses.map(([c, m]) => `${c}:${m}`).join(", ")}`)
|