/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * `osm`: OpenStreetMap address adapter for the countries no permissive source covers. * * Every row lists `ODbL-1.0`, whose recorded obligations include share-alike. A build run under * `LicensePolicy.ShareAlikeFree` refuses these rows at ingest, so they reach only the open weights. * That is why `defaultLicense` is not an option on this adapter. */ import { type AdapterOptions, type CanonicalRow, type CorpusAdapter } from "#types"; /** * Registry id for this adapter, stamped into every row it emits. */ export declare const OSM_ADAPTER_ID = "osm"; /** * OpenStreetMap's license. * * Its recorded obligations include share-alike, so a build run under * `LicensePolicy.ShareAlikeFree` refuses every row carrying it. */ export declare const OSM_LICENSE = "ODbL-1.0"; /** * The URL of the ODbL license text. */ export declare const OSM_LICENSE_URL = "https://opendatacommons.org/licenses/odbl/1-0/"; /** * The attribution OSM requires in redistributed data and derived works. * * A database built from OSM embeds it, and a model card carries it when OSM-derived * rows reached the checkpoint, which the effective training manifest records. */ export declare const OSM_ATTRIBUTION: string; /** * 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; country?: string; } /** * Whether `addr:housenumber` holds a street designator — 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`) — rather than free text such * as `House 34, Road 4, Sector 9`, `Plot #27` or a name. */ export declare function housenumberIsDesignator(value: string): boolean; /** * Whether `addr:street` matches the street-name shape. * * The value has no comma and contains at most {@link MAX_STREET_WORDS} words. * Direction phrases such as `Near Cozy Water Park`, `Opposite Askari Towers` or `Behind …` return false. */ export declare function isStreetName(value: string): boolean; /** * Split an `addr:city` carrying a neighborhood ahead of the city (`Mirpur 10, Dhaka` → * locality `Dhaka`, head `Mirpur 10`); a value without a comma is only the locality. */ export declare function splitCityValue(value: string): { locality: string; head: string | null; }; /** * Maps one jsonl row onto the components the corpus asserts, or returns null when the row is refused. * * A row with a street-shaped `addr:street` is a street address. * A row with no `addr:street` at all is admitted as a streetless premise when its house * number is designator-shaped and a tag that maps to `locality` or `dependent_locality` * (`addr:city`, `addr:place`, `addr:suburb`, `addr:subdistrict`, `addr:district`) * carries the identity the street would have carried. * * That is OSM's documented scheme for addresses numbered within a named place * rather than along a street, and it is the `streetless-premise-identity` shape. * A row whose `addr:street` holds a line rather than a name stays refused: * the mapper supplied a street, and the value is a line. * * Each refusal and each discarded component increments its reason in `dropped`. */ export declare function componentsForOSMRow(row: OSMCorpusRow, dropped?: Pick): 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