/** * @file Renders one Japanese address row in one register and checks the record. * * A register is one way of writing the same address, and most registers never occur in the source, so synthesis is * their only route into the corpus. {@linkcode RowRenderer} records each span as it appends the field. * * Ported from the Python builders' `countries/jp/corpora/rows.py`. */ import type { SeededRandom } from "@mailwoman/core/math/random"; import { type CJKRecord } from "#cjk/builder"; import type { JPSourceRow } from "#jp/corpus/sources"; /** * The label set the Japanese corpus is tagged against. */ export declare const JP_LABEL_SET_NAME = "stage3-jp"; /** * The corpus source string for these rows. * Configs use this value as the source weight key. */ export declare const JP_CORPUS_SOURCE = "overture-jp"; /** * Each register's weight. * * The sampler renormalizes them over the registers a row can render. */ export declare const JP_REGISTER_WEIGHTS: Map; /** * The fields of one source row and the draws that decide its surface. */ export interface JPRenderInput { prefecture: string; municipality: string; district: string; chome: number | null; number: string; postcode: string | null; register: string; spaced: boolean; country: boolean; hyphen?: string; municipalityKana?: string | null; } /** * One row rendered in one register, largest component first, as a span-labeled corpus record. * * `spaced` puts one ASCII space between the admin components. * The 〒 mark sits outside the postcode span. * * @throws When the `kana_municipality` register has no kana reading. */ export declare function renderJPRow(input: JPRenderInput): CJKRecord; /** * The registers a row can render. * * A number with a non-digit part (`362B-2`) renders only natively. * A row without a chōme also allows the designator register. * `kana` allows the kana-municipality register. */ export declare function availableJPRegisters(chome: number | null, number: string, kana?: boolean): string[]; /** * One of `options`, drawn by {@linkcode JP_REGISTER_WEIGHTS}. * A single option is returned without a draw. */ export declare function chooseJPRegister(rng: SeededRandom, options: readonly string[]): string; /** * {@linkcode verifyRecord} under {@linkcode JP_LABEL_SET_NAME}. */ export declare function verifyJPRecord(record: CJKRecord, tagSet: ReadonlySet): void; /** * Collects deduplicated bare-district (`日本橋本石町`) and chō-only admin (`東京都中央区日本橋本石町`) * rows from selected JP source rows for districts starting with `日本` (#2931). * * Consumes no RNG state, preserving exact draw parity for all standard registers. */ export declare function collectBareJPDistrictRows(rows: readonly JPSourceRow[]): CJKRecord[]; //# sourceMappingURL=rows.d.ts.map