/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * `osm`: OpenStreetMap address adapter (#733) for the countries no permissive source covers. Overture's addresses * theme has no rows for Pakistan, Bangladesh or Vietnam (the three parquets are 532-byte headers), and the Latin * model has never seen their formats: the Islamabad sector line, the Dhaka trailing postcode, the `Đường`-led street. * * This adapter consumes the per-country JSONL `@mailwoman/osm`'s `emit-corpus-jsonl` script writes from a Geofabrik * extract (`{ street, number, postcode?, suburb?, city?, unit?, place?, subdistrict?, district?, province?, lat, lon * }`), the same split the `overture` adapter rides so the corpus package never meets GDAL or a PBF. * * ⚠ ODbL. Every row carries `license: "ODbL-1.0"`, which `SHARE_ALIKE_PATTERN` matches: a proprietary-weights build * passes `--exclude-share-alike` and drops these rows at ingest, so they reach the open weights only. That is the * whole licensing contract of this adapter, and the reason `defaultLicense` is not an option. * * The mapping keeps to what a person types on the envelope. Mappers put free text in `addr:housenumber` (`House 34, * Road 4, Sector 9`, `Near Askari Towers 2`) and in `addr:street`; a house number is kept only in a designator shape, * and a street with a comma or more than eight words is skipped as a line rather than a name. `addr:city` in * Bangladesh often carries the neighborhood too (`Mirpur 10, Dhaka`): the last comma-separated part is the locality * and the head becomes the dependent locality when no `addr:suburb` names one. `addr:district` is NOT mapped on its * own: for Vietnam it is the quận below the city, which the country template renders only when no city is present, * so a mapped district with a city would be a component with no span to align to and the row would quarantine. * * | JSONL field | ComponentTag | * | ------------------------------------------ | --------------------------------------------------------- | * | `number` | `house_number` when designator-shaped (`12`, `14/E`, `B-77`) | * | `street` | `street` (keyword included; affix-relabel splits it) | * | `unit` | `unit` | * | `postcode` | `postcode` when 4–6 digits | * | `city` (tail after the last comma) | `locality` | * | `suburb` ?? `subdistrict` ?? `district` ?? `place` ?? city head | `dependent_locality` | * | `province` | `region`, unless it repeats the locality | */ import type { CanonicalRow, CorpusAdapter } from "#types"; /** * Registry id for this adapter, stamped into every row it emits. */ export declare const OSM_ADAPTER_ID = "osm"; /** * OpenStreetMap's license. Share-alike: `SHARE_ALIKE_PATTERN` matches it, and `--exclude-share-alike` drops the rows. */ export declare const OSM_LICENSE = "ODbL-1.0"; /** * The per-row shape `@mailwoman/osm`'s `emit-corpus-jsonl` writes. */ interface OSMCorpusRow { street?: string; number?: string; postcode?: string; suburb?: string; city?: string; unit?: string; place?: string; subdistrict?: string; district?: string; province?: string; } /** * Whether `addr:housenumber` holds a designator a person writes after or before the street: digits with an optional * letter, fraction or dash suffix (`12`, `188a`, `14/E`, `1/1146`, `167-c`), or a one- or two-letter block prefix * (`B-77`, `L58`, `R 948`, Karachi's plot numbering). `House 34, Road 4, Sector 9`, `Plot #27`, `-` and a name are * not. */ export declare function housenumberIsDesignator(value: string): boolean; /** * Whether `addr:street` is a street name: no comma, at most {@link MAX_STREET_WORDS} words, and not a direction (`Near * Cozy Water Park`, `Opposite Askari Towers`, `Behind …`). */ export declare function isStreetName(value: string): boolean; /** * Split an `addr:city` that carries a neighborhood ahead of the city (`Mirpur 10, Dhaka` → locality `Dhaka`, head * `Mirpur 10`). A value without a comma is the locality alone. */ export declare function splitCityValue(value: string): { locality: string; head: string | null; }; /** * Map one JSONL row onto the components the corpus asserts, or null when the row has no usable street. */ export declare function componentsForOSMRow(row: OSMCorpusRow): CanonicalRow["components"] | null; /** * Whether two place names are the same name: case, whitespace, diacritics and a leading admin generic folded (`Bắc * Ninh` = `Bac Ninh`; `Hà Nội` = `Thành phố Hà Nội`). */ export declare function sameName(a: string, b: string): boolean; export declare function createOSMAdapter(): CorpusAdapter; /** * The configured adapter instance registered with the corpus builder. */ export declare const osmAdapter: CorpusAdapter; export {}; //# sourceMappingURL=adapter.d.ts.map