kokorog2p documentation

kokorog2p is a multilingual grapheme-to-phoneme and Kokoro model adaptation layer. The core accepts prepared, speakable text and an explicit language.

Responsibility boundary

KokoroG2P owns tokenization, phonological normalization, language routing requested by the caller, annotations, overrides, and phoneme/model output. It does not verbalize numbers, abbreviations, units, currencies, dates, URLs, or other written semantics. Applications may prepare those forms with an external tool such as Spokenform before calling phonemize_prepared().

Quick start

from kokorog2p import phonemize_prepared

result = phonemize_prepared(
    "Hello world!", language="en-us", lexicons=()
)
print(result.phonemes)

See Quick Start, prepared phonemization, and the span guide for details.