pub mod cmu;
pub mod espeak;
pub mod misaki;
pub mod openphonemizer;
pub use cmu::CmuDictionaryBackend;
pub use espeak::EspeakBackend;
pub use misaki::MisakiBackend;
pub use openphonemizer::OpenPhonemizerBackend;
use std::collections::HashMap;
use crate::execution::types::ExecutorResult;
pub trait PhonemizerBackend: Send + Sync {
fn phonemize(&self, text: &str, tokens_map: &HashMap<char, i64>) -> ExecutorResult<String>;
fn phonemize_raw(&self, text: &str) -> ExecutorResult<String> {
let mut universal_map = HashMap::new();
for i in 0x20u32..0x2000 {
if let Some(c) = char::from_u32(i) {
universal_map.insert(c, i as i64);
}
}
self.phonemize(text, &universal_map)
}
fn name(&self) -> &'static str;
}