phonemize
Version:
Fast phonemizer with rule-based G2P prediction. Pure JavaScript implementation.
16 lines (15 loc) • 769 B
TypeScript
/**
* Russian text normalization for preProcess.
*
* Reads cardinals positionally in the nominative case (masculine where
* gender matters, feminine for the thousands group since "тысяча" is
* feminine). Plural agreement is applied for thousand/million/billion
* scales and for the recurring units (рубль/доллар/процент/etc.) using
* the standard 1 / 2-4 / 5+ split.
*
* What's intentionally NOT here: case agreement with the counted noun
* past the immediate currency/percent words. Reading "5 книг" as
* "пять книг" vs "пять книги" requires morphological analysis of the
* surrounding noun, which is out of scope for a text-only preProcess.
*/
export declare function expandRussianText(text: string): string;