import type { PathBuilderLike } from "path-ts"; import { type CJKRecord } from "#cjk/builder"; /** * The corpus source of the register's rows. */ export declare const TW_REGISTRY_SOURCE = "gcis-tw"; /** * The hold-out bucket from which a Taiwanese (縣市, 鄉鎮市區) unit is a board unit: buckets 90 to 99 of 100. */ export declare const TW_BOARD_BUCKET_MIN = 90; /** * A house number with its sub-numbers and 號 at the head of a string (`120號`, `64之3號`), * with the remainder in `rest`. */ export declare const TW_HOUSE_NUMBER: RegExp; /** * A floor written after a house number: `1樓`, `B1`, `地下室`, optionally in parentheses. */ export declare const TW_FLOOR: RegExp; /** * The admin levels required in an Overture-TW row are 縣市, 鄉鎮市區 and 村里. */ export declare const TW_ADMIN_LEVELS = 3; /** * A register or Overture value folded to its key: whitespace-free NFC, ASCII digits, * 台 as 臺, and a section number up to 十 in kanji. */ export declare function twFoldKey(text: string): string; /** * The Overture-TW key sets: regions, each region's districts, and each unit's villages and streets. */ export declare class TWKeyIndex { readonly regions: Set; readonly districtsByRegion: Map>; readonly villagesByUnit: Map>; readonly streetsByUnit: Map>; /** * Builds the index from an Overture-TW parquet file, or from its first `maxRowGroups` row groups. * * @throws When the file is missing. */ static fromParquet(parquet: PathBuilderLike, maxRowGroups?: number): Promise; } /** * One register row's name and its two address forms. */ export interface TWRegisterRow { name: string; address: string; taxAddress: string; } /** * Every register row with an address, from each CSV in `sourceDirectory` in code-point order of their paths. * * @throws When the directory is missing or holds no CSV, naming it. */ export declare function iterTWRegisterRows(sourceDirectory: PathBuilderLike): AsyncGenerator; /** * A register address rendered whitespace-free and spanned. */ export interface TWAligned { raw: string; span_starts: number[]; span_ends: number[]; span_tags: string[]; register: string; region: string; district: string; } /** * A register address aligned to region, district, village, street, number and floor, * or `null` when any required part doesn't match the key sets. */ export declare function alignRegisterAddress(text: string, index: TWKeyIndex): TWAligned | null; /** * An aligned row as a corpus record, its whole raw string one token. */ export declare function twRegistryRecord(aligned: TWAligned): CJKRecord; //# sourceMappingURL=registers.d.ts.map