import { type JusoLabelRow } from "#kr/adapters/juso/label-rows"; /** * The key sets keyed as the register nests them, as composite string keys rather than * nested maps, because a nested map costs a second lookup on the hot path. */ export interface KeyIndex { regions: Set; /** * 시도 → its 시군구 names. */ sigunguByRegion: Map>; /** * 시도 and 시군구 → the unit's road names. */ roadsByUnit: Map>; /** * 시도 and 시군구 → the unit's 동 and 읍/면 names. */ dongsByUnit: Map>; /** * 시도, 시군구 and 동 → the 동's 리 names. */ risByDong: Map>; } export declare function emptyKeyIndex(): KeyIndex; /** * Add one label row's names to the key sets. * * The 읍/면 joins the unit's 동 set as a road-form token, since the road address * writes it between the 시군구 and the road. */ export declare function indexLabelRow(index: KeyIndex, row: JusoLabelRow): void; /** * Admit the pre-merger region names as aliases of the register's current one, sharing its * sets by reference so a later `indexLabelRow` under either name reaches the same set. */ export declare function aliasKeyIndex(index: KeyIndex): void; /** * The number of tokens from `start` that form one of the region's 시군구 — * 2 for `수원시 장안구`, 1 for `종로구`, 0 for none. * * Two-token first, because `수원시` by itself is also listed and taking it would * leave `장안구` to be read as a road. */ export declare function sigunguSpan(index: KeyIndex, region: string, tokens: readonly string[], start: number): number; /** * The key sets the permit aligner reads, from one pass over the register rows. */ export declare function buildKeyIndex(rows: AsyncIterable): Promise; //# sourceMappingURL=key-index.d.ts.map