import { PathBuilder, type PathBuilderLike } from "path-ts"; import { createOpenNamesReadStats } from "#gb/os-open/open/names"; import { createOpenRoadsReadStats } from "#gb/os-open/open/roads"; import { type TieredNumberBand } from "#synthesizers/utils"; import { type CorpusAdapter } from "#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 GB_OS_OPEN_ADAPTER_ID = "gb-os-open"; /** * The license on all three products, and on every row. */ export declare const GB_OS_OPEN_LICENSE = "OGL-UK-3.0"; /** * The jurisdictions the adapter emits. * * Code-Point Open covers Great Britain and includes no `BT` postcodes. */ export declare const GB_OS_OPEN_COUNTRIES: readonly string[]; /** * The farthest a road link may lie from a postcode's point and still name its street, in EPSG:27700 meters. */ export declare const GB_OS_OPEN_JOIN_RADIUS_M = 100; /** * The subdirectory of `inputPath` that holds each product. */ export declare const GB_OS_OPEN_PRODUCT_DIRECTORIES: { readonly codePointOpen: "code-point-open"; readonly openNames: "open-names"; readonly openRoads: "open-roads"; }; /** * The rows `mailwoman corpus run gb-os-open --out $MAILWOMAN_DATA_ROOT/corpus/staging/gb-os-open` writes. * * The `locale` recipe's GB part and `#gb/recipes/house-venue-tuples` read their * Great Britain address skeletons from this file. */ export declare function gbOSOpenCanonicalRowsPath(): PathBuilder; /** * The bands the drawn house number comes from. * * Seven in ten draws fall in 1–60, a quarter in 61–200, and the rest in 201–400. */ export declare const GB_OS_OPEN_HOUSE_NUMBER_BANDS: readonly TieredNumberBand[]; /** * What one run read, dropped and emitted. */ export interface GBOSOpenSummary { /** * Code-Point rows read, including rows with no coordinate. */ codePointRows: number; /** * Code-Point rows that failed the parser's shape checks. */ codePointMalformed: number; /** * Rows per `Positional_quality_indicator` value, including 90. */ pqi: Record; /** * Postcodes with a coordinate, the denominator of the join. */ postcodesWithCoordinate: number; /** * Postcodes with a road link with a name within the radius, counted before any drop. */ joined: number; dropped: { /** * Positional quality 90: the row has no coordinate. */ noCoordinate: number; /** * The coordinate is shared with another postcode. */ sharedCoordinate: number; /** * No road link with a name lies within the radius. */ noLinkWithinRadius: number; /** * The link's TOID has no road row in Open Names. */ noOpenNamesRow: number; /** * The road's `POSTCODE_DISTRICT` isn't the postcode's outward code. */ districtMismatch: number; }; /** * Rows emitted. */ emitted: number; /** * Emitted streets that OS wrote with no lowercase letter and that were title-cased. */ titleCasedStreets: number; /** * Emitted rows with no `POPULATED_PLACE`, so no locality. */ noLocality: number; /** * Emitted rows whose `POPULATED_PLACE` was bilingual, of which the first name was kept. */ bilingualLocality: number; roads: ReturnType; names: ReturnType; } /** * Construction options. */ export interface GBOSOpenAdapterOptions { /** * Receives the run's counts once the rows are exhausted. */ onSummary?: (summary: GBOSOpenSummary) => void; } /** * The three product directories under `inputPath`. * * @throws Naming the missing path, when a product's subdirectory is absent. */ export declare function gbOSOpenProductPaths(inputPath: PathBuilderLike): Promise>; /** * The house number drawn for one postcode and road, from {@linkcode GB_OS_OPEN_HOUSE_NUMBER_BANDS}. * * The seed is the row's source id, so a rerun draws the same number. */ export declare function drawGBHouseNumber(sourceID: string): string; /** * Creates the OS OpenData adapter. */ export declare function createGBOSOpenAdapter(options?: GBOSOpenAdapterOptions): CorpusAdapter; /** * The configured adapter instance registered with the corpus builder. */ export declare const gbOSOpenAdapter: CorpusAdapter; //# sourceMappingURL=adapter.d.ts.map