piper-phoneme-streaming 0.1.1

A high-performance Rust library for streaming Text-to-Phoneme (G2P) conversion.
Documentation
mod full;
mod streaming;

pub use full::FullG2p;
pub use streaming::{StreamingG2P, StreamingG2pSession};

use crate::Language;
/// Represents a single grapheme-to-phoneme output unit.
///
/// Contains the generated phoneme character and the exact language context
/// it was resolved under.
pub struct G2pToken {
    /// The actual phoneme string (rendered appropriately for espeak-ng/piper).
    pub token: char,
    /// The language used to resolve this particular token.
    pub language: Language,
}

impl G2pToken {
    pub fn new(token: char, language: Language) -> Self {
        Self { token, language }
    }
}