/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * `openaddresses`: Line-delimited GeoJSON adapter for openaddresses.io exports. * * OpenAddresses publishes country-partitioned address dumps as either CSV or line-delimited GeoJSON * (one `Feature` per line, also called ND-GeoJSON / GeoJSONL). This adapter consumes the * line-delimited GeoJSON shape — it streams cleanly without holding the file in memory, which * matters for the multi-gigabyte national dumps (e.g. `us-northeast.geojsonl`, ~20M rows). * * The collection aggregates **hundreds** of underlying sources with **per-source licenses** (city * open-data portals, county GIS departments, state DOTs). The adapter therefore prefers the * per-row `LICENSE` property when present and falls back to the configured `defaultLicense`. The * propagated license travels with each `CanonicalRow` so downstream code can stratify, exclude, * or re-attribute by license at training time. * * Country must be explicit (`opts.country` REQUIRED): OpenAddresses files are organized by country * but the row-level data doesn't include a country code, so the adapter refuses to run without * one. This matches how a `mailwoman corpus build` invocation pins each file to a country via the * inputs JSON. * * Properties consumed (per the canonical OpenAddresses schema; both UPPERCASE and lowercase * variants are accepted because legacy dumps used UPPERCASE): * * | Property | ComponentTag | | ------------- | * -------------------------------------------------------------- | | `number` | `house_number` | * | `street` | `street` | | `unit` | `unit` (if non-empty) | | `city` | `locality` | | `region` | * `region` (state code for US, province for CA, etc.) | | `postcode` | `postcode` | | `LICENSE` | * per-row `license` override | | `hash` / `id` | `source_id` (prefer `hash`; fall back to `id`; * then synthesize)| * * `district` is intentionally NOT mapped — for US data it carries borough or county and would * inflate alignment quarantine because postal addresses don't include it. Phase 6+ may revisit * for non-US locales where district names DO appear on the envelope. */ import type { CorpusAdapter } from "@mailwoman/corpus/types"; /** * Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset * it came from. */ export declare const OPENADDRESSES_ADAPTER_ID = "openaddresses"; /** * License carried by this source (CC-BY-4.0), attached to each row so downstream consumers inherit the terms rather * than having to look them up. */ export declare const OPENADDRESSES_DEFAULT_LICENSE = "CC-BY-4.0"; export interface OpenaddressesAdapterOptions { /** * Per-row license used when a Feature lacks an explicit `LICENSE` property. Defaults to `CC-BY-4.0` — the most common * license across the OpenAddresses collection. Override per dump via the runner's adapter-options passthrough. */ defaultLicense?: string; /** * Per-adapter share-alike drop. Default **true** (include) as of 2026-06-19: exclusion is a deliberate BUILD-level * act (`buildCorpus({ excludeLicenses })` / `--exclude-share-alike`), NOT a silent adapter default (#26 — "purposely * exclude, don't opt in to include"). Set false only for an explicit adapter-scoped drop; the build-level * `--exclude-share-alike` is the normal path. */ allowShareAlike?: boolean; } /** * Build an OpenAddresses adapter. The optional `defaultLicense` lets callers stamp a non-default fallback for dumps * known to carry a single license throughout (e.g. a PDDL-only state slice). */ export declare function createOpenaddressesAdapter(opts?: OpenaddressesAdapterOptions): CorpusAdapter; /** * The configured adapter instance registered with the corpus builder. */ export declare const openaddressesAdapter: CorpusAdapter; //# sourceMappingURL=adapter.d.ts.map