import { type CJKRecord } from "#cjk/builder"; /** * Countries whose rows the CJK family already reads from its own sources. * * Every member writes an official language in Han, Kana or Hangul * (`foreign-places.test.ts` checks it against `countriesOfScript`). * The script sets also hold SG. * * The CJK family has no source of its own for SG's Chinese-script rows, * so they stay foreign rows and route here. */ export declare const CJK_COUNTRIES: import("@mailwoman/codex/country/sets").CountrySet<{ declaredBy: "CJK family corpora"; }>; /** * The least share of a row's letters in Han, Kana or Hangul for the row to route to the CJK family. * * A localized hierarchy is written wholly in its language, so its share is 1.0. * A row that keeps a Latin ancestor (`フェアモント, WV`) mixes scripts and stays with * the family its address body's script selects. */ export declare const MIN_CJK_SHARE = 0.9; /** * The corpus source the rows keep, so the source register and rights records already cover them. */ export declare const FOREIGN_PLACES_SOURCE = "wof-admin"; /** * Every routed row uses this register. */ export declare const FOREIGN_PLACES_REGISTER = "wof-foreign-cjk"; /** * The share of `text`'s letters that are Han, Kana or Hangul, or 0 for a text with no letter. * * A letter is `\p{L}` at the running Node's Unicode version (`isLetter`), * and a CJK Extension I or J character is a CJK letter. */ export declare function cjkShare(text: string): number; /** * Whether a row is a CJK-script place row of a country outside {@linkcode CJK_COUNTRIES}. */ export declare function isForeignCJKRow(row: { raw: string; country: string; }): boolean; /** * Each wanted UTF-16 offset into `text` mapped to its code-point index. * * @throws When an offset falls inside a surrogate pair or past the end, naming the offsets that miss. */ export declare function utf16Boundaries(text: string, offsets: Iterable): Map; /** * One corpus row as the builder reads it. */ export interface ForeignPlaceRow { raw: string; tokens: string[]; labels: string[]; span_starts: number[]; span_ends: number[]; span_tags: string[]; country: string; source_id: string; } /** * The CJK-schema record of one corpus row, its span offsets moved from UTF-16 units to code points. */ export declare function toForeignPlaceRecord(row: ForeignPlaceRow): CJKRecord; /** * Each held-out `source_id` mapped to `val` or `test`, from a split attribute * file `corpus split-overlay` wrote. * An id listed under both is `test`. * * @throws When the file is missing or lacks either list. */ export declare function heldOutIDs(splitAttribute: string): Promise>; /** * Options for {@linkcode buildForeignPlaces}. */ export interface ForeignPlacesOptions { parquet: string; splitAttribute: string; outDir: string; force?: boolean; } /** * Writes the foreign-place CJK corpus and returns its build report. * * A row the record check refuses is counted under the defect's kind and left out. * * @throws When `outDir` holds a file and `force` is unset, an input is missing, or no row routes to train. */ export declare function buildForeignPlaces(options: ForeignPlacesOptions): Promise>; //# sourceMappingURL=foreign-places.d.ts.map