import type { PostalGuidelineLeg, PostalGuidelinePlace } from "#recipes/postal/guideline/leg"; import { type CorpusRecipe } from "#recipes/scaffold"; import { type LabeledRow } from "#types"; import { type CountryHoldout } from "#utils/split"; /** * The legs the recipe runs, one per country. */ export declare const POSTAL_GUIDELINE_LEGS: readonly PostalGuidelineLeg[]; /** * Rows written per leg when `--count` isn't given. */ export declare const POSTAL_GUIDELINE_DEFAULT_COUNT = 2000; /** * One emitted row. */ export type PostalGuidelineRow = LabeledRow & { template: string; base_source_id: null; register: string; surface: string; }; /** * Options for {@link generatePostalGuidelineRows}. */ export interface PostalGuidelineRowsOptions { /** * Every renderable place of each leg's country, keyed by country code. */ places: ReadonlyMap; /** * Rows per leg. */ count: number; seed: number; source: string; legs?: readonly PostalGuidelineLeg[]; /** * @defaultValue `defaultHoldouts()` */ holdouts?: Record; } /** * The places of one leg, in input order and without repeats, divided by whether the split holds them out. */ export declare function partitionPlaces(leg: PostalGuidelineLeg, places: readonly PostalGuidelinePlace[], holdouts: Record): { train: PostalGuidelinePlace[]; heldOut: PostalGuidelinePlace[]; }; /** * Renders and aligns the rows of every leg. * * Each row's split is the one {@linkcode splitForRow} gives its place, as for every other source. * A leg draws a street or residence name only from places on the same side of the holdout * as the row's own place, so a training row never writes a held-out place's name. * * Throws when a leg has no place or cannot reach `count` rows, rather than returning fewer. */ export declare function generatePostalGuidelineRows(opts: PostalGuidelineRowsOptions): PostalGuidelineRow[]; /** * Reads one country's GeoNames postal export, as `.txt` or `.zip` under the * data root's `geonames-postal` directory, through the leg's row reader. */ export declare function readPostalGuidelinePlaces(leg: PostalGuidelineLeg): Promise; /** * The registered recipe. */ export declare const postalGuidelineRecipe: CorpusRecipe; //# sourceMappingURL=guideline.d.ts.map