import type { PathBuilderLike } from "path-ts"; import { type DisposableDuckDB } from "#parquet/duckdb"; import { type CorpusRecipe, type RecipeTuple } from "#recipes/scaffold"; /** * The Overture release the venue-head table is built from, so the two read one name population. */ export declare const DEFAULT_VENUE_NAMES: PathBuilderLike; /** * Venue names drawn per country when `--count` is absent. */ export declare const DEFAULT_NAMES_PER_COUNTRY = 20000; /** * Share of locality rows that also print the region when `--venue-region-fraction` is absent. */ export declare const DEFAULT_REGION_FRACTION = 0.5; /** * The two written shapes. */ export declare const VenueTemplate: { /** * The venue name as the whole query. */ readonly Bare: "venue-bare"; /** * The venue name, a comma, and a locality of the same country. */ readonly Locality: "venue-locality"; }; /** * One of {@linkcode VenueTemplate}. */ export type VenueTemplate = (typeof VenueTemplate)[keyof typeof VenueTemplate]; /** * A head lookup for one country, the shape `venueHeadLexicon` returns. */ export interface VenueHeadSuffixLookup { suffix(word: string): number | null; } /** * Characters a spaceless-script name needs before it is written as a bare query. * * A two-character name such as `東京` is the length of a city name. * The head the table recognizes is the name's last character, so a name shorter * than this is a head with one character of stem. */ export declare const MIN_SPACELESS_BARE_CHARACTERS = 3; /** * Whether a name may be written as the whole query. * * In a spaced script the name needs two or more words, and at least one word * with a letter, so `24 7` and `A1` stay out. * In a script written without spaces a name is one word, so it qualifies when it has three or more * characters and ends in a venue head the table holds for the country, as `国立西洋美術館` ends in `館`. * * A spaceless name the table doesn't recognize is written beside a locality only. */ export declare function isBareVenueName(name: string, heads?: VenueHeadSuffixLookup): boolean; /** * The comparison key for a name against the country's localities. */ export declare function venueNameKey(name: string): string; /** * Admin tuples grouped by country, with the locality set each country's names are checked against. */ export interface CountryTuples { tuples: RecipeTuple[]; localities: Set; } /** * The ISO 3166-1 alpha-2 code of a tuple's country. * * `corpus tuples` writes the code under `cc` and the display name under `country`. * Older tuples files write the code under `country`. * A tuple with neither form returns `null`. */ export declare function tupleCountryCode(tuple: RecipeTuple): string | null; /** * Groups the admin tuples by country and keeps those with a locality. */ export declare function groupTuplesByCountry(input: PathBuilderLike): Promise>; /** * Reads up to `limit` distinct names of one country from the Overture names file. * * The order is a hash of the name and the seed, so one seed draws one sample and a second seed another. */ export declare function readVenueNames(db: DisposableDuckDB, venueNames: PathBuilderLike, country: string, limit: number, seed: number): Promise; /** * Recipe registered with the corpus builder. * * `--input` supplies locality, region and country tuples, and every country * in it with venue names is covered. * `--count` caps the names drawn per country. * `--venue-names` points at the Overture names file. */ export declare const venueRecipe: CorpusRecipe; //# sourceMappingURL=venue.d.ts.map