@mailwoman/registry 10.7.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -98
- package/data/manifests/artifacts.json +32 -0
- package/data/manifests/coverage.json +56 -0
- package/data/manifests/sources.lock.json +48 -0
- package/data/normalized/iata-airports.json +126749 -0
- package/data/normalized/iso3166-1.json +2035 -0
- package/definitions/namespaces.json +63 -0
- package/definitions/sections.json +73 -0
- package/docs/data-policy.md +81 -0
- package/docs/performance.md +146 -0
- package/docs/rgy1.md +144 -0
- package/lib/artifacts/country-airport-collision.ts +26 -0
- package/lib/artifacts/iata-airport/membership.ts +26 -0
- package/lib/artifacts/iata-airport/records.ts +26 -0
- package/lib/artifacts/iso3166-1/alpha2-membership.ts +26 -0
- package/lib/artifacts/iso3166-1/alpha3-membership.ts +26 -0
- package/lib/artifacts/iso3166-1/records.ts +26 -0
- package/lib/errors.ts +44 -0
- package/lib/iata/airports/records.ts +174 -0
- package/lib/iata/airports/validate.ts +49 -0
- package/lib/index.ts +25 -15
- package/lib/inspect.ts +56 -0
- package/lib/iso3166/alpha2.ts +48 -0
- package/lib/iso3166/alpha3.ts +51 -0
- package/lib/iso3166/records.ts +149 -0
- package/lib/iso3166/relations.ts +30 -0
- package/lib/key.ts +146 -0
- package/lib/normalize.ts +31 -0
- package/lib/overlap/country-airport.ts +108 -0
- package/lib/rgy1/base64.ts +24 -0
- package/lib/rgy1/reader.ts +316 -0
- package/lib/rgy1/sections.generated.ts +79 -0
- package/lib/rgy1/views.ts +267 -0
- package/lib/types.ts +88 -74
- package/lib/wasm.ts +285 -0
- package/out/artifacts/country-airport-collision.d.ts +15 -0
- package/out/artifacts/country-airport-collision.d.ts.map +1 -0
- package/out/artifacts/country-airport-collision.js +21 -0
- package/out/artifacts/country-airport-collision.js.map +1 -0
- package/out/artifacts/iata-airport/membership.d.ts +15 -0
- package/out/artifacts/iata-airport/membership.d.ts.map +1 -0
- package/out/artifacts/iata-airport/membership.js +21 -0
- package/out/artifacts/iata-airport/membership.js.map +1 -0
- package/out/artifacts/iata-airport/records.d.ts +15 -0
- package/out/artifacts/iata-airport/records.d.ts.map +1 -0
- package/out/artifacts/iata-airport/records.js +21 -0
- package/out/artifacts/iata-airport/records.js.map +1 -0
- package/out/artifacts/iso3166-1/alpha2-membership.d.ts +15 -0
- package/out/artifacts/iso3166-1/alpha2-membership.d.ts.map +1 -0
- package/out/artifacts/iso3166-1/alpha2-membership.js +21 -0
- package/out/artifacts/iso3166-1/alpha2-membership.js.map +1 -0
- package/out/artifacts/iso3166-1/alpha3-membership.d.ts +15 -0
- package/out/artifacts/iso3166-1/alpha3-membership.d.ts.map +1 -0
- package/out/artifacts/iso3166-1/alpha3-membership.js +21 -0
- package/out/artifacts/iso3166-1/alpha3-membership.js.map +1 -0
- package/out/artifacts/iso3166-1/records.d.ts +15 -0
- package/out/artifacts/iso3166-1/records.d.ts.map +1 -0
- package/out/artifacts/iso3166-1/records.js +21 -0
- package/out/artifacts/iso3166-1/records.js.map +1 -0
- package/out/errors.d.ts +38 -0
- package/out/errors.d.ts.map +1 -0
- package/out/errors.js +35 -0
- package/out/errors.js.map +1 -0
- package/out/iata/airports/records.d.ts +44 -0
- package/out/iata/airports/records.d.ts.map +1 -0
- package/out/iata/airports/records.js +137 -0
- package/out/iata/airports/records.js.map +1 -0
- package/out/iata/airports/validate.d.ts +27 -0
- package/out/iata/airports/validate.d.ts.map +1 -0
- package/out/iata/airports/validate.js +42 -0
- package/out/iata/airports/validate.js.map +1 -0
- package/out/index.d.ts +19 -15
- package/out/index.d.ts.map +1 -1
- package/out/index.js +14 -15
- package/out/index.js.map +1 -1
- package/out/inspect.d.ts +38 -0
- package/out/inspect.d.ts.map +1 -0
- package/out/inspect.js +33 -0
- package/out/inspect.js.map +1 -0
- package/out/iso3166/alpha2.d.ts +24 -0
- package/out/iso3166/alpha2.d.ts.map +1 -0
- package/out/iso3166/alpha2.js +41 -0
- package/out/iso3166/alpha2.js.map +1 -0
- package/out/iso3166/alpha3.d.ts +29 -0
- package/out/iso3166/alpha3.d.ts.map +1 -0
- package/out/iso3166/alpha3.js +44 -0
- package/out/iso3166/alpha3.js.map +1 -0
- package/out/iso3166/records.d.ts +38 -0
- package/out/iso3166/records.d.ts.map +1 -0
- package/out/iso3166/records.js +105 -0
- package/out/iso3166/records.js.map +1 -0
- package/out/iso3166/relations.d.ts +20 -0
- package/out/iso3166/relations.d.ts.map +1 -0
- package/out/iso3166/relations.js +27 -0
- package/out/iso3166/relations.js.map +1 -0
- package/out/key.d.ts +68 -0
- package/out/key.d.ts.map +1 -0
- package/out/key.js +122 -0
- package/out/key.js.map +1 -0
- package/out/normalize.d.ts +25 -0
- package/out/normalize.d.ts.map +1 -0
- package/out/normalize.js +21 -0
- package/out/normalize.js.map +1 -0
- package/out/overlap/country-airport.d.ts +57 -0
- package/out/overlap/country-airport.d.ts.map +1 -0
- package/out/overlap/country-airport.js +71 -0
- package/out/overlap/country-airport.js.map +1 -0
- package/out/rgy1/base64.d.ts +15 -0
- package/out/rgy1/base64.d.ts.map +1 -0
- package/out/rgy1/base64.js +22 -0
- package/out/rgy1/base64.js.map +1 -0
- package/out/rgy1/reader.d.ts +103 -0
- package/out/rgy1/reader.d.ts.map +1 -0
- package/out/rgy1/reader.js +230 -0
- package/out/rgy1/reader.js.map +1 -0
- package/out/rgy1/sections.generated.d.ts +54 -0
- package/out/rgy1/sections.generated.d.ts.map +1 -0
- package/out/rgy1/sections.generated.js +69 -0
- package/out/rgy1/sections.generated.js.map +1 -0
- package/out/rgy1/views.d.ts +96 -0
- package/out/rgy1/views.d.ts.map +1 -0
- package/out/rgy1/views.js +218 -0
- package/out/rgy1/views.js.map +1 -0
- package/out/sdk/fetch.d.ts +53 -0
- package/out/sdk/fetch.d.ts.map +1 -0
- package/out/sdk/fetch.js +107 -0
- package/out/sdk/fetch.js.map +1 -0
- package/out/sdk/fetch.run.d.ts +14 -0
- package/out/sdk/fetch.run.d.ts.map +1 -0
- package/out/sdk/fetch.run.js +20 -0
- package/out/sdk/fetch.run.js.map +1 -0
- package/out/sdk/sources.d.ts +111 -0
- package/out/sdk/sources.d.ts.map +1 -0
- package/out/sdk/sources.js +98 -0
- package/out/sdk/sources.js.map +1 -0
- package/out/tools/artifact-path.d.ts +10 -0
- package/out/tools/artifact-path.d.ts.map +1 -0
- package/out/tools/artifact-path.js +12 -0
- package/out/tools/artifact-path.js.map +1 -0
- package/out/tools/bench.run.d.ts +19 -0
- package/out/tools/bench.run.d.ts.map +1 -0
- package/out/tools/bench.run.js +204 -0
- package/out/tools/bench.run.js.map +1 -0
- package/out/tools/build-wasm.run.d.ts +18 -0
- package/out/tools/build-wasm.run.d.ts.map +1 -0
- package/out/tools/build-wasm.run.js +71 -0
- package/out/tools/build-wasm.run.js.map +1 -0
- package/out/tools/generate-sections.run.d.ts +13 -0
- package/out/tools/generate-sections.run.d.ts.map +1 -0
- package/out/tools/generate-sections.run.js +136 -0
- package/out/tools/generate-sections.run.js.map +1 -0
- package/out/tools/generate.run.d.ts +18 -0
- package/out/tools/generate.run.d.ts.map +1 -0
- package/out/tools/generate.run.js +118 -0
- package/out/tools/generate.run.js.map +1 -0
- package/out/tools/normalize.d.ts +155 -0
- package/out/tools/normalize.d.ts.map +1 -0
- package/out/tools/normalize.js +303 -0
- package/out/tools/normalize.js.map +1 -0
- package/out/tools/normalize.run.d.ts +14 -0
- package/out/tools/normalize.run.d.ts.map +1 -0
- package/out/tools/normalize.run.js +29 -0
- package/out/tools/normalize.run.js.map +1 -0
- package/out/types.d.ts +90 -76
- package/out/types.d.ts.map +1 -1
- package/out/types.js +20 -4
- package/out/types.js.map +1 -1
- package/out/wasm.d.ts +98 -0
- package/out/wasm.d.ts.map +1 -0
- package/out/wasm.js +137 -0
- package/out/wasm.js.map +1 -0
- package/package.json +49 -28
- package/sdk/fetch.run.ts +24 -0
- package/sdk/fetch.ts +146 -0
- package/sdk/sources.ts +162 -0
- package/tools/artifact-path.ts +12 -0
- package/tools/bench.run.ts +265 -0
- package/tools/build-wasm.run.ts +82 -0
- package/tools/generate-sections.run.ts +152 -0
- package/tools/generate.run.ts +146 -0
- package/tools/normalize.run.ts +36 -0
- package/tools/normalize.ts +474 -0
- package/wasm/registry-simd.wasm +0 -0
- package/wasm/registry.wasm +0 -0
- package/lib/address-key.ts +0 -46
- package/lib/geocode-handler.ts +0 -37
- package/lib/geojson.ts +0 -73
- package/lib/ingest.ts +0 -349
- package/lib/learned-scorer.ts +0 -134
- package/lib/map-html.ts +0 -287
- package/lib/models/crosssource-gbt-en-us.ts +0 -43
- package/lib/models/dedup-gbt-en-us.ts +0 -47
- package/lib/models/org-crosssource-gbt-en-us.ts +0 -43
- package/lib/reconcile.ts +0 -239
- package/lib/resolve.ts +0 -570
- package/out/address-key.d.ts +0 -34
- package/out/address-key.d.ts.map +0 -1
- package/out/address-key.js +0 -41
- package/out/address-key.js.map +0 -1
- package/out/geocode-handler.d.ts +0 -20
- package/out/geocode-handler.d.ts.map +0 -1
- package/out/geocode-handler.js +0 -29
- package/out/geocode-handler.js.map +0 -1
- package/out/geojson.d.ts +0 -28
- package/out/geojson.d.ts.map +0 -1
- package/out/geojson.js +0 -63
- package/out/geojson.js.map +0 -1
- package/out/ingest.d.ts +0 -173
- package/out/ingest.d.ts.map +0 -1
- package/out/ingest.js +0 -185
- package/out/ingest.js.map +0 -1
- package/out/learned-scorer.d.ts +0 -61
- package/out/learned-scorer.d.ts.map +0 -1
- package/out/learned-scorer.js +0 -91
- package/out/learned-scorer.js.map +0 -1
- package/out/map-html.d.ts +0 -39
- package/out/map-html.d.ts.map +0 -1
- package/out/map-html.js +0 -220
- package/out/map-html.js.map +0 -1
- package/out/models/crosssource-gbt-en-us.d.ts +0 -45
- package/out/models/crosssource-gbt-en-us.d.ts.map +0 -1
- package/out/models/crosssource-gbt-en-us.js +0 -40
- package/out/models/crosssource-gbt-en-us.js.map +0 -1
- package/out/models/dedup-gbt-en-us.d.ts +0 -44
- package/out/models/dedup-gbt-en-us.d.ts.map +0 -1
- package/out/models/dedup-gbt-en-us.js +0 -44
- package/out/models/dedup-gbt-en-us.js.map +0 -1
- package/out/models/org-crosssource-gbt-en-us.d.ts +0 -45
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +0 -1
- package/out/models/org-crosssource-gbt-en-us.js +0 -40
- package/out/models/org-crosssource-gbt-en-us.js.map +0 -1
- package/out/reconcile.d.ts +0 -96
- package/out/reconcile.d.ts.map +0 -1
- package/out/reconcile.js +0 -127
- package/out/reconcile.js.map +0 -1
- package/out/resolve.d.ts +0 -264
- package/out/resolve.d.ts.map +0 -1
- package/out/resolve.js +0 -282
- package/out/resolve.js.map +0 -1
- package/out/tools/coverage-reconciliation.d.ts +0 -67
- package/out/tools/coverage-reconciliation.d.ts.map +0 -1
- package/out/tools/coverage-reconciliation.js +0 -113
- package/out/tools/coverage-reconciliation.js.map +0 -1
- package/out/tools/cross/dataset-correlation.d.ts +0 -61
- package/out/tools/cross/dataset-correlation.d.ts.map +0 -1
- package/out/tools/cross/dataset-correlation.js +0 -244
- package/out/tools/cross/dataset-correlation.js.map +0 -1
- package/out/tools/cross/source-threshold-sweep.d.ts +0 -60
- package/out/tools/cross/source-threshold-sweep.d.ts.map +0 -1
- package/out/tools/cross/source-threshold-sweep.js +0 -264
- package/out/tools/cross/source-threshold-sweep.js.map +0 -1
- package/out/tools/dedup-ceiling.d.ts +0 -62
- package/out/tools/dedup-ceiling.d.ts.map +0 -1
- package/out/tools/dedup-ceiling.js +0 -171
- package/out/tools/dedup-ceiling.js.map +0 -1
- package/out/tools/eval-geocoder.d.ts +0 -68
- package/out/tools/eval-geocoder.d.ts.map +0 -1
- package/out/tools/eval-geocoder.js +0 -13
- package/out/tools/eval-geocoder.js.map +0 -1
- package/out/tools/geocoder/namesake-probe.d.ts +0 -33
- package/out/tools/geocoder/namesake-probe.d.ts.map +0 -1
- package/out/tools/geocoder/namesake-probe.js +0 -60
- package/out/tools/geocoder/namesake-probe.js.map +0 -1
- package/out/tools/geocoder/vs-provided-coords.d.ts +0 -53
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +0 -1
- package/out/tools/geocoder/vs-provided-coords.js +0 -161
- package/out/tools/geocoder/vs-provided-coords.js.map +0 -1
- package/out/tools/gold-set-sample.d.ts +0 -67
- package/out/tools/gold-set-sample.d.ts.map +0 -1
- package/out/tools/gold-set-sample.js +0 -81
- package/out/tools/gold-set-sample.js.map +0 -1
- package/out/tools/learned/scorer/clustering-eval.d.ts +0 -77
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +0 -1
- package/out/tools/learned/scorer/clustering-eval.js +0 -207
- package/out/tools/learned/scorer/clustering-eval.js.map +0 -1
- package/out/tools/learned/scorer/crossstate-eval.d.ts +0 -65
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +0 -1
- package/out/tools/learned/scorer/crossstate-eval.js +0 -168
- package/out/tools/learned/scorer/crossstate-eval.js.map +0 -1
- package/out/tools/learned/scorer/eval.d.ts +0 -64
- package/out/tools/learned/scorer/eval.d.ts.map +0 -1
- package/out/tools/learned/scorer/eval.js +0 -275
- package/out/tools/learned/scorer/eval.js.map +0 -1
- package/out/tools/matcher-scale.d.ts +0 -40
- package/out/tools/matcher-scale.d.ts.map +0 -1
- package/out/tools/matcher-scale.js +0 -111
- package/out/tools/matcher-scale.js.map +0 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +0 -82
- package/out/tools/nppes/dedup-benchmark.d.ts.map +0 -1
- package/out/tools/nppes/dedup-benchmark.js +0 -226
- package/out/tools/nppes/dedup-benchmark.js.map +0 -1
- package/out/tools/nppes/org-name.d.ts +0 -15
- package/out/tools/nppes/org-name.d.ts.map +0 -1
- package/out/tools/nppes/org-name.js +0 -6
- package/out/tools/nppes/org-name.js.map +0 -1
- package/out/tools/nppes/overmerge-packet.d.ts +0 -43
- package/out/tools/nppes/overmerge-packet.d.ts.map +0 -1
- package/out/tools/nppes/overmerge-packet.js +0 -54
- package/out/tools/nppes/overmerge-packet.js.map +0 -1
- package/out/tools/nppes/report.d.ts +0 -97
- package/out/tools/nppes/report.d.ts.map +0 -1
- package/out/tools/nppes/report.js +0 -178
- package/out/tools/nppes/report.js.map +0 -1
- package/out/tools/nppes/sample.d.ts +0 -101
- package/out/tools/nppes/sample.d.ts.map +0 -1
- package/out/tools/nppes/sample.js +0 -127
- package/out/tools/nppes/sample.js.map +0 -1
- package/out/tools/nppes/scoring.d.ts +0 -37
- package/out/tools/nppes/scoring.d.ts.map +0 -1
- package/out/tools/nppes/scoring.js +0 -81
- package/out/tools/nppes/scoring.js.map +0 -1
- package/out/tools/nppes/settings.d.ts +0 -41
- package/out/tools/nppes/settings.d.ts.map +0 -1
- package/out/tools/nppes/settings.js +0 -79
- package/out/tools/nppes/settings.js.map +0 -1
- package/out/tools/nppes/truth-grains.d.ts +0 -63
- package/out/tools/nppes/truth-grains.d.ts.map +0 -1
- package/out/tools/nppes/truth-grains.js +0 -139
- package/out/tools/nppes/truth-grains.js.map +0 -1
- package/out/tools/shared.d.ts +0 -325
- package/out/tools/shared.d.ts.map +0 -1
- package/out/tools/shared.js +0 -453
- package/out/tools/shared.js.map +0 -1
- package/out/tools/train/cross-gbt.d.ts +0 -89
- package/out/tools/train/cross-gbt.d.ts.map +0 -1
- package/out/tools/train/cross-gbt.js +0 -132
- package/out/tools/train/cross-gbt.js.map +0 -1
- package/out/tools/train/gbt.d.ts +0 -85
- package/out/tools/train/gbt.d.ts.map +0 -1
- package/out/tools/train/gbt.js +0 -155
- package/out/tools/train/gbt.js.map +0 -1
- package/out/tools/train/org-cross-gbt.d.ts +0 -85
- package/out/tools/train/org-cross-gbt.d.ts.map +0 -1
- package/out/tools/train/org-cross-gbt.js +0 -122
- package/out/tools/train/org-cross-gbt.js.map +0 -1
- package/out/tools/txhhsc-to-oarow.d.ts +0 -42
- package/out/tools/txhhsc-to-oarow.d.ts.map +0 -1
- package/out/tools/txhhsc-to-oarow.js +0 -78
- package/out/tools/txhhsc-to-oarow.js.map +0 -1
- package/out/tools/viz/browser.d.ts +0 -31
- package/out/tools/viz/browser.d.ts.map +0 -1
- package/out/tools/viz/browser.js +0 -26
- package/out/tools/viz/browser.js.map +0 -1
- package/out/tools/viz/cross-dataset-map.d.ts +0 -39
- package/out/tools/viz/cross-dataset-map.d.ts.map +0 -1
- package/out/tools/viz/cross-dataset-map.js +0 -84
- package/out/tools/viz/cross-dataset-map.js.map +0 -1
- package/out/tools/viz/geocode-first-surface.d.ts +0 -36
- package/out/tools/viz/geocode-first-surface.d.ts.map +0 -1
- package/out/tools/viz/geocode-first-surface.js +0 -234
- package/out/tools/viz/geocode-first-surface.js.map +0 -1
- package/out/tools/viz/render/map.d.ts +0 -42
- package/out/tools/viz/render/map.d.ts.map +0 -1
- package/out/tools/viz/render/map.js +0 -40
- package/out/tools/viz/render/map.js.map +0 -1
- package/out/tools/viz/render.d.ts +0 -46
- package/out/tools/viz/render.d.ts.map +0 -1
- package/out/tools/viz/render.js +0 -49
- package/out/tools/viz/render.js.map +0 -1
- package/out/tools/viz/source-provenance-map.d.ts +0 -57
- package/out/tools/viz/source-provenance-map.d.ts.map +0 -1
- package/out/tools/viz/source-provenance-map.js +0 -82
- package/out/tools/viz/source-provenance-map.js.map +0 -1
- package/out/tools/viz/yardstick-figure.d.ts +0 -22
- package/out/tools/viz/yardstick-figure.d.ts.map +0 -1
- package/out/tools/viz/yardstick-figure.js +0 -106
- package/out/tools/viz/yardstick-figure.js.map +0 -1
- package/tools/coverage-reconciliation.ts +0 -192
- package/tools/cross/dataset-correlation.ts +0 -380
- package/tools/cross/source-threshold-sweep.ts +0 -416
- package/tools/dedup-ceiling.ts +0 -225
- package/tools/eval-geocoder.ts +0 -77
- package/tools/geocoder/namesake-probe.ts +0 -91
- package/tools/geocoder/vs-provided-coords.ts +0 -232
- package/tools/gold-set-sample.ts +0 -147
- package/tools/learned/scorer/clustering-eval.ts +0 -349
- package/tools/learned/scorer/crossstate-eval.ts +0 -280
- package/tools/learned/scorer/eval.ts +0 -429
- package/tools/matcher-scale.ts +0 -185
- package/tools/nppes/dedup-benchmark.ts +0 -364
- package/tools/nppes/org-name.ts +0 -15
- package/tools/nppes/overmerge-packet.ts +0 -98
- package/tools/nppes/report.ts +0 -380
- package/tools/nppes/sample.ts +0 -250
- package/tools/nppes/scoring.ts +0 -115
- package/tools/nppes/settings.ts +0 -102
- package/tools/nppes/truth-grains.ts +0 -181
- package/tools/shared.ts +0 -743
- package/tools/train/cross-gbt.ts +0 -214
- package/tools/train/gbt.ts +0 -261
- package/tools/train/org-cross-gbt.ts +0 -189
- package/tools/txhhsc-to-oarow.ts +0 -118
- package/tools/viz/browser.ts +0 -41
- package/tools/viz/cross-dataset-map.ts +0 -133
- package/tools/viz/geocode-first-surface.ts +0 -305
- package/tools/viz/render/map.ts +0 -61
- package/tools/viz/render.ts +0 -103
- package/tools/viz/source-provenance-map.ts +0 -154
- package/tools/viz/yardstick-figure.ts +0 -197
package/out/reconcile.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { formatPersonName } from "@mailwoman/record/name";
|
|
2
|
-
import { toFeature } from "#geojson";
|
|
3
|
-
/**
|
|
4
|
-
* Places an entity in a reconciliation bucket by whether its source labels include
|
|
5
|
-
* eligibility sources, funding sources, or both.
|
|
6
|
-
*
|
|
7
|
-
* @returns `null` when the entity has neither kind of source.
|
|
8
|
-
*/
|
|
9
|
-
export function bucketOf(sources, config) {
|
|
10
|
-
const elig = new Set(config.eligibilitySources);
|
|
11
|
-
const fund = new Set(config.fundingSources);
|
|
12
|
-
let hasEligibility = false;
|
|
13
|
-
let hasFunding = false;
|
|
14
|
-
for (const s of sources) {
|
|
15
|
-
if (elig.has(s)) {
|
|
16
|
-
hasEligibility = true;
|
|
17
|
-
}
|
|
18
|
-
if (fund.has(s)) {
|
|
19
|
-
hasFunding = true;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (hasEligibility && hasFunding)
|
|
23
|
-
return "enrolled";
|
|
24
|
-
if (hasEligibility)
|
|
25
|
-
return "eligible-not-enrolled";
|
|
26
|
-
if (hasFunding)
|
|
27
|
-
return "funded-not-eligible";
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Buckets resolved entities by their sources with {@link bucketOf}.
|
|
32
|
-
*
|
|
33
|
-
* Entities without an eligibility or funding source are dropped.
|
|
34
|
-
*/
|
|
35
|
-
export function reconcileCoverage(entities, config) {
|
|
36
|
-
const reconciled = [];
|
|
37
|
-
const counts = {
|
|
38
|
-
enrolled: 0,
|
|
39
|
-
"eligible-not-enrolled": 0,
|
|
40
|
-
"funded-not-eligible": 0,
|
|
41
|
-
};
|
|
42
|
-
for (const entity of entities) {
|
|
43
|
-
const sources = [...new Set(entity.records.map((r) => r.source).filter((s) => !!s))].toSorted();
|
|
44
|
-
const bucket = bucketOf(sources, config);
|
|
45
|
-
if (!bucket)
|
|
46
|
-
continue;
|
|
47
|
-
reconciled.push({ entity, sources, bucket });
|
|
48
|
-
counts[bucket]++;
|
|
49
|
-
}
|
|
50
|
-
return { reconciled, counts };
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Returns a display name for an entity's representative record.
|
|
54
|
-
*
|
|
55
|
-
* It prefers the organization's canonical name, then the person's name, then the record ID.
|
|
56
|
-
*/
|
|
57
|
-
export function repName(entity) {
|
|
58
|
-
const rep = entity.representative;
|
|
59
|
-
const person = formatPersonName(rep.name ?? null, "short");
|
|
60
|
-
return rep.organization?.canonical ?? (person || rep.id);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Converts the reconciled entities that have coordinates to point features tagged with their bucket.
|
|
64
|
-
*/
|
|
65
|
-
export function reconciliationGeoJSON(result) {
|
|
66
|
-
return {
|
|
67
|
-
type: "FeatureCollection",
|
|
68
|
-
features: result.reconciled
|
|
69
|
-
.filter((c) => c.entity.coordinate)
|
|
70
|
-
.map((c) => toFeature(c.entity, { bucket: c.bucket, name: repName(c.entity) })),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Renders a Markdown reconciliation report with the bucket counts, the enrolled rate,
|
|
75
|
-
* a spot-check of `eligible-not-enrolled` entities and a fixed caveat.
|
|
76
|
-
*
|
|
77
|
-
* The report presents the enrolled rate as a floor because incomplete resolution can only miss links.
|
|
78
|
-
*/
|
|
79
|
-
export function reconciliationReport(result, options = {}) {
|
|
80
|
-
const { counts, reconciled } = result;
|
|
81
|
-
const title = options.title ?? "Coverage reconciliation — eligibility ↔ enrollment";
|
|
82
|
-
const spotCheckLimit = options.spotCheckLimit ?? 15;
|
|
83
|
-
const eligibleTotal = counts.enrolled + counts["eligible-not-enrolled"];
|
|
84
|
-
const enrolledRate = eligibleTotal > 0 ? (100 * counts.enrolled) / eligibleTotal : 0;
|
|
85
|
-
const lines = [`# ${title}`, ""];
|
|
86
|
-
if (options.scopeNote) {
|
|
87
|
-
lines.push(`_${options.scopeNote}_`);
|
|
88
|
-
lines.push("");
|
|
89
|
-
}
|
|
90
|
-
if (options.scorerNote) {
|
|
91
|
-
lines.push(options.scorerNote);
|
|
92
|
-
lines.push("");
|
|
93
|
-
}
|
|
94
|
-
lines.push(`## The reconciliation`);
|
|
95
|
-
lines.push("");
|
|
96
|
-
lines.push(`| bucket | entities | meaning |`);
|
|
97
|
-
lines.push(`|---|---:|---|`);
|
|
98
|
-
lines.push(`| **enrolled** | ${counts.enrolled} | resolves to an eligibility record AND a funding record |`);
|
|
99
|
-
lines.push(`| **eligible, not enrolled** | ${counts["eligible-not-enrolled"]} | eligibility record without a resolved funding record (the **anti-join**) |`);
|
|
100
|
-
lines.push(`| **funded, not in eligibility set** | ${counts["funded-not-eligible"]} | funding record without a resolved eligibility record |`);
|
|
101
|
-
lines.push("");
|
|
102
|
-
lines.push(`Of the ${eligibleTotal} entities with an eligibility record, ${enrolledRate.toFixed(1)}% also resolve to a ` +
|
|
103
|
-
`funding record — a **floor**, not a coverage rate (imperfect resolution + any sampling only ever miss ` +
|
|
104
|
-
`links, never invent them). The deliverable is the anti-join SET, not this percentage.`);
|
|
105
|
-
lines.push("");
|
|
106
|
-
lines.push(`## Anti-join spot-check — first ${spotCheckLimit} "eligible, not enrolled"`);
|
|
107
|
-
lines.push("");
|
|
108
|
-
lines.push(`| entity | sources | name | coordinate |`);
|
|
109
|
-
lines.push(`|---|---|---|---|`);
|
|
110
|
-
for (const c of reconciled.filter((x) => x.bucket === "eligible-not-enrolled").slice(0, spotCheckLimit)) {
|
|
111
|
-
const coord = c.entity.coordinate
|
|
112
|
-
? `${c.entity.coordinate.latitude.toFixed(4)}, ${c.entity.coordinate.longitude.toFixed(4)}`
|
|
113
|
-
: "—";
|
|
114
|
-
lines.push(`| ${c.entity.id} | ${c.sources.join(", ")} | ${repName(c.entity)} | ${coord} |`);
|
|
115
|
-
}
|
|
116
|
-
lines.push("");
|
|
117
|
-
lines.push(`## The caveat that matters`);
|
|
118
|
-
lines.push("");
|
|
119
|
-
const sample = options.sampleNote ? `${options.sampleNote} ` : "";
|
|
120
|
-
lines.push(`${sample}This is a **set-membership reconciliation, not a determination**. A missing funding record can mean ` +
|
|
121
|
-
`the entity didn't apply, applied under a name we didn't resolve, is ineligible, or any number of things. We ` +
|
|
122
|
-
`produce the reconciled join and surface the candidate set; **what a gap means, and whether to act on it, is ` +
|
|
123
|
-
`entirely the data consumer's call.** Nothing here is an allegation.`);
|
|
124
|
-
lines.push("");
|
|
125
|
-
return lines.join("\n");
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=reconcile.js.map
|
package/out/reconcile.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../lib/reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AA0CpC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAA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,CAAC,CAAC,EAAE,CAAA;IAEjE,KAAK,CAAC,IAAI,CACT,GAAG,MAAM,sGAAsG;QAC9G,8GAA8G;QAC9G,8GAA8G;QAC9G,qEAAqE,CACtE,CAAA;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
package/out/resolve.d.ts
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The resolve pipeline wires the matching modules over concrete contact and organization records.
|
|
7
|
-
*
|
|
8
|
-
* The upstream pipeline geocodes each `address` and supplies its coordinate and canonical key.
|
|
9
|
-
*/
|
|
10
|
-
import { type BlockingKey, type FellegiSunterModel, type GBT, type TermFrequencyTable } from "@mailwoman/match";
|
|
11
|
-
import type { ResolvedEntity, SourceRecord } from "#types";
|
|
12
|
-
/**
|
|
13
|
-
* Cheap, parse-free normalization for the address-frequency key: uppercase,
|
|
14
|
-
* collapse whitespace, drop punctuation.
|
|
15
|
-
*
|
|
16
|
-
* The count covers distinct entities that share an address.
|
|
17
|
-
* It is computable over millions of rows without geocoding.
|
|
18
|
-
*
|
|
19
|
-
* A crowded clinic or billing address is weak identity evidence.
|
|
20
|
-
* A lonely address is strong.
|
|
21
|
-
*/
|
|
22
|
-
export declare function addressFrequencyKey(raw: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Last-10-digit normalization for phone agreement, dropping country code, punctuation and extensions.
|
|
25
|
-
*
|
|
26
|
-
* A shorter digit string is kept as-is, since partial agreement still contributes
|
|
27
|
-
* weight in the comparison model.
|
|
28
|
-
* `null` means no digits at all.
|
|
29
|
-
*/
|
|
30
|
-
export declare function normalizePhone(raw: string | null | undefined): string | null;
|
|
31
|
-
/**
|
|
32
|
-
* {@link normalizePhone} under the probes' stricter interface, where only a full line counts.
|
|
33
|
-
*
|
|
34
|
-
* Returns the last 10 digits when the input contains at least 10.
|
|
35
|
-
* Returns `""` for shorter input, so callers never receive a partial digit string.
|
|
36
|
-
*
|
|
37
|
-
* Callers guard on truthiness, so `""` reads as no comparable phone rather than a weaker key.
|
|
38
|
-
*/
|
|
39
|
-
export declare function normalizePhoneStrict(raw: string | null | undefined): string;
|
|
40
|
-
/**
|
|
41
|
-
* Options for {@link buildDefaultModel}.
|
|
42
|
-
*
|
|
43
|
-
* Each change is default-off, so the base model is byte-stable.
|
|
44
|
-
*/
|
|
45
|
-
export interface DefaultModelOptions {
|
|
46
|
-
/**
|
|
47
|
-
* Corpus-wide address-frequency table over {@link addressFrequencyKey}, which makes
|
|
48
|
-
* the address agreement weight inverse to how shared the address is.
|
|
49
|
-
*
|
|
50
|
-
* A building with 50 providers makes a same-address match near-worthless evidence.
|
|
51
|
-
*
|
|
52
|
-
* The table's `value` is the record's raw address string.
|
|
53
|
-
*/
|
|
54
|
-
addressFrequency?: TermFrequencyTable;
|
|
55
|
-
/**
|
|
56
|
-
* Collapse the redundant address-key and great-circle-distance comparisons into one
|
|
57
|
-
* {@link spatialComparison spatial-agreement} signal, an exact-key tier over distance buckets.
|
|
58
|
-
*
|
|
59
|
-
* Removes the double-count that over-merges co-located providers, since an
|
|
60
|
-
* exact key match already implies distance ≈ 0.
|
|
61
|
-
*/
|
|
62
|
-
collapseSpatial?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Add a normalized-phone exact-match comparison.
|
|
65
|
-
*
|
|
66
|
-
* A shared line is strong evidence and the secondary corroborator that lets a
|
|
67
|
-
* true same-entity link survive name drift.
|
|
68
|
-
*/
|
|
69
|
-
usePhone?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Extra secondary-identifier comparisons drawn from {@link SourceRecord.attributes},
|
|
72
|
-
* such as `["authorizedOfficial"]`.
|
|
73
|
-
*
|
|
74
|
-
* Each becomes an `attr:<key>` comparison and counts toward corroboration.
|
|
75
|
-
* It is a more reliable discriminator than phone where the data has one.
|
|
76
|
-
*/
|
|
77
|
-
discriminators?: string[];
|
|
78
|
-
/**
|
|
79
|
-
* Closed-vocabulary code-set discriminators drawn from {@link SourceRecord.attributes},
|
|
80
|
-
* such as NPPES taxonomy codes or license numbers.
|
|
81
|
-
*
|
|
82
|
-
* The attribute value is a whitespace-joined set of codes.
|
|
83
|
-
* Any shared code counts as agreement.
|
|
84
|
-
*
|
|
85
|
-
* This is set overlap rather than string similarity, since `207R00000X`
|
|
86
|
-
* and `207Q00000X` are different specialties despite near-identical text.
|
|
87
|
-
*
|
|
88
|
-
* Similarity scores mis-rank that case because the codes identify different specialties.
|
|
89
|
-
* The over-merge separator: two co-located records of one entity nearly always share
|
|
90
|
-
* a code, while two distinct co-located providers mostly do not.
|
|
91
|
-
*/
|
|
92
|
-
exactDiscriminators?: string[];
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* The default geocode-first scoring model: name, organization and a spatial signal.
|
|
96
|
-
*
|
|
97
|
-
* The spatial signal is either two comparisons (address-key similarity and great-circle distance)
|
|
98
|
-
* or, with {@link DefaultModelOptions.collapseSpatial}, one collapsed {@link spatialComparison}.
|
|
99
|
-
* `addressFrequency` down-weights agreement on a crowded address either way.
|
|
100
|
-
*/
|
|
101
|
-
export declare function buildDefaultModel(opts?: DefaultModelOptions): FellegiSunterModel<SourceRecord>;
|
|
102
|
-
/**
|
|
103
|
-
* The default blocking keys include location and canonical address.
|
|
104
|
-
* They also include phone and email.
|
|
105
|
-
*/
|
|
106
|
-
export declare function defaultBlockingKeys(): BlockingKey<SourceRecord>[];
|
|
107
|
-
/**
|
|
108
|
-
* Options for {@link resolveEntities}.
|
|
109
|
-
*/
|
|
110
|
-
export interface ResolveConfig {
|
|
111
|
-
/**
|
|
112
|
-
* The model used to score candidate pairs.
|
|
113
|
-
*
|
|
114
|
-
* @defaultValue {@link buildDefaultModel}
|
|
115
|
-
*/
|
|
116
|
-
model?: FellegiSunterModel<SourceRecord>;
|
|
117
|
-
/**
|
|
118
|
-
* The blocking keys whose union forms the candidate set.
|
|
119
|
-
*
|
|
120
|
-
* @defaultValue {@link defaultBlockingKeys}
|
|
121
|
-
*/
|
|
122
|
-
blockingKeys?: BlockingKey<SourceRecord>[];
|
|
123
|
-
/**
|
|
124
|
-
* Link two records into the same entity at or above this match weight (bits).
|
|
125
|
-
*
|
|
126
|
-
* @defaultValue `0`
|
|
127
|
-
*/
|
|
128
|
-
threshold?: number;
|
|
129
|
-
/**
|
|
130
|
-
* Skip and report blocks larger than this rather than scanning them.
|
|
131
|
-
*/
|
|
132
|
-
maxBlockSize?: number;
|
|
133
|
-
/**
|
|
134
|
-
* Fit the model's `m`/`u` to the candidate pairs with EM before scoring (label-free).
|
|
135
|
-
*
|
|
136
|
-
* @defaultValue `false`
|
|
137
|
-
*/
|
|
138
|
-
trainEM?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Address-frequency table over {@link addressFrequencyKey}, which down-weights address
|
|
141
|
-
* agreement by how shared the address is. **Default-on:** when omitted, `resolveEntities`
|
|
142
|
-
* computes the table over the input records' addresses, the right scope for a single dataset.
|
|
143
|
-
*
|
|
144
|
-
* Pass your own {@link TermFrequencyTable} (for example a corpus-wide one) to override,
|
|
145
|
-
* or `false` to disable (the legacy bare baseline).
|
|
146
|
-
* Ignored if `model` is supplied.
|
|
147
|
-
*/
|
|
148
|
-
addressFrequency?: TermFrequencyTable | false;
|
|
149
|
-
/**
|
|
150
|
-
* Collapse the redundant address-key and distance pair into one {@link spatialComparison}.
|
|
151
|
-
* **Default-on (true)** is the cleaner, less-over-merging spatial model.
|
|
152
|
-
*
|
|
153
|
-
* Set `false` for the legacy two-signal baseline.
|
|
154
|
-
* Ignored if `model` is supplied.
|
|
155
|
-
*/
|
|
156
|
-
collapseSpatial?: boolean;
|
|
157
|
-
/**
|
|
158
|
-
* Require positive name or organization corroboration ({@link CORROBORATING_FIELDS}) for
|
|
159
|
-
* a link, so a shared address cannot merge two records without that corroboration.
|
|
160
|
-
*
|
|
161
|
-
* Suppresses the spatial-only links that fuse distinct co-located providers.
|
|
162
|
-
*
|
|
163
|
-
* @defaultValue `false`
|
|
164
|
-
*/
|
|
165
|
-
requireCorroboration?: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* Add a normalized-phone comparison to the default model.
|
|
168
|
-
*
|
|
169
|
-
* Phone agreement provides strong secondary evidence when entity names have drifted.
|
|
170
|
-
*
|
|
171
|
-
* Ignored if `model` is supplied.
|
|
172
|
-
*/
|
|
173
|
-
usePhone?: boolean;
|
|
174
|
-
/**
|
|
175
|
-
* The clustering step uses this linkage method.
|
|
176
|
-
*
|
|
177
|
-
* `"single"` (default) is connected components, while `"average"` is an average-linkage
|
|
178
|
-
* refinement that splits a component whose sub-clusters are joined only by a weak bridge.
|
|
179
|
-
*/
|
|
180
|
-
linkage?: "single" | "average";
|
|
181
|
-
/**
|
|
182
|
-
* Extra secondary-identifier keys from {@link SourceRecord.attributes} to add as
|
|
183
|
-
* comparisons and corroborators, for example `["authorizedOfficial"]`.
|
|
184
|
-
*
|
|
185
|
-
* Ignored if `model` is supplied.
|
|
186
|
-
*/
|
|
187
|
-
discriminators?: string[];
|
|
188
|
-
/**
|
|
189
|
-
* Closed-vocabulary code-set discriminator keys ({@link DefaultModelOptions.exactDiscriminators}),
|
|
190
|
-
* which use set-overlap agreement.
|
|
191
|
-
* An example is `["taxonomy"]`.
|
|
192
|
-
*
|
|
193
|
-
* Also corroborators.
|
|
194
|
-
* Ignored if `model` is supplied.
|
|
195
|
-
*/
|
|
196
|
-
exactDiscriminators?: string[];
|
|
197
|
-
/**
|
|
198
|
-
* Override the Fellegi-Sunter link weight with a learned score.
|
|
199
|
-
*
|
|
200
|
-
* When set, a candidate pair's match weight is this function's return value instead of
|
|
201
|
-
* {@link scorePair}'s, in the same threshold-comparable units as the FS weight.
|
|
202
|
-
* Default is undefined (pure FS).
|
|
203
|
-
*
|
|
204
|
-
* The blocking and clustering are unchanged, so a trained scorer can be A/B tested
|
|
205
|
-
* against the FS baseline on the identical pipeline.
|
|
206
|
-
* The function is responsible for its own feature computation, such as the
|
|
207
|
-
* agreement pattern plus any corpus statistics it captured.
|
|
208
|
-
*
|
|
209
|
-
* The corroboration check is independent of the learned score and is still evaluated on
|
|
210
|
-
* the Fellegi-Sunter `contributions`, so a learned-high pair with no positive FS name,
|
|
211
|
-
* organization or phone agreement is still held out.
|
|
212
|
-
*
|
|
213
|
-
* A learned scorer is normally trained to subsume corroboration, so use one or the other.
|
|
214
|
-
* The independent FS check can veto the learned score when both checks run.
|
|
215
|
-
*/
|
|
216
|
-
scorer?: (a: SourceRecord, b: SourceRecord) => number;
|
|
217
|
-
/**
|
|
218
|
-
* The learned gradient-boosted-tree scorer, default-on.
|
|
219
|
-
*
|
|
220
|
-
* Omitted or `true` uses the bundled {@link DEDUP_GBT_MODEL}, which was trained on
|
|
221
|
-
* the NPPES NPI-truth set and beats the Fellegi-Sunter baseline by roughly +5pp dedup
|
|
222
|
-
* F1 held-out within a state and +22pp on states it never trained on.
|
|
223
|
-
*
|
|
224
|
-
* `false` opts out to the pure FS baseline.
|
|
225
|
-
* Pass your own {@link GBT} for a custom model.
|
|
226
|
-
*
|
|
227
|
-
* The scorer is built over the same collapsed-spatial and address-frequency feature
|
|
228
|
-
* model as training, independent of this call's comparison config.
|
|
229
|
-
* An explicit {@link scorer} takes precedence.
|
|
230
|
-
*
|
|
231
|
-
* When the bundled model is active and no {@link threshold} is set,
|
|
232
|
-
* its calibrated link threshold ({@link DEDUP_GBT_META}.recommendedThreshold) is used,
|
|
233
|
-
* because the GBT logit is not in FS-weight units and 0 would over-merge.
|
|
234
|
-
*
|
|
235
|
-
* The model is NPPES/US-trained.
|
|
236
|
-
* For a very different domain, A/B it or pass `false`.
|
|
237
|
-
*/
|
|
238
|
-
learnedScorer?: boolean | GBT;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* The result of a resolve pass.
|
|
242
|
-
*/
|
|
243
|
-
export interface ResolveResult {
|
|
244
|
-
entities: ResolvedEntity[];
|
|
245
|
-
/**
|
|
246
|
-
* Number of candidate pairs blocking produced.
|
|
247
|
-
*/
|
|
248
|
-
candidatePairs: number;
|
|
249
|
-
/**
|
|
250
|
-
* Blocks too large to scan, surfaced so coverage limits are visible.
|
|
251
|
-
*/
|
|
252
|
-
droppedBlocks: Array<{
|
|
253
|
-
key: string;
|
|
254
|
-
size: number;
|
|
255
|
-
}>;
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Resolve source records into canonical entities: block, score, cluster.
|
|
259
|
-
*
|
|
260
|
-
* Every record belongs to exactly one entity.
|
|
261
|
-
* A record without a confident link forms a singleton entity.
|
|
262
|
-
*/
|
|
263
|
-
export declare function resolveEntities(records: readonly SourceRecord[], config?: ResolveConfig): ResolveResult;
|
|
264
|
-
//# sourceMappingURL=resolve.d.ts.map
|
package/out/resolve.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../lib/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,GAAG,EAER,KAAK,kBAAkB,EAgBvB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMvD;AAiDD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK5E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAI3E;AAWD;;;;G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