import { G2PProcessor } from "./g2p"; export type EnglishDialect = "en-US" | "en-GB"; export interface HomographEntry { pronunciation: string; pos: string; } export interface HomographDict { [word: string]: HomographEntry[]; } export declare class G2PModel implements G2PProcessor { private dictionary; /** * Per-instance custom pronunciations. We keep these separate from * `this.dictionary` (which references the shared module-level JSON * object) so that `addPronunciation()` on one instance doesn't leak * to other instances created in the same process. */ private customDict; private homographs; private disableDict; private dialect; readonly id = "en-g2p"; readonly name = "English G2P Processor"; /** * Accepts the bare `en` tag plus both major dialects. The same * instance can serve both — see `predict()` for per-call dispatch. */ readonly supportedLanguages: string[]; constructor(options?: { disableDict?: boolean; dialect?: EnglishDialect; }); predict(word: string, language?: string, pos?: string): string | null; private predictInternal; private matchPos; private wellKnown; private tryMorphologicalAnalysis; private tryDecomposition; private syllabify; private assignStress; private isSyllableHeavy; private isLikelyCompound; private syllableToIPA; addPronunciation(word: string, pronunciation: string): void; } export default G2PModel;