1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! # shabda — Grapheme-to-Phoneme Conversion
//!
//! **shabda** (Sanskrit: word / sound) provides text-to-phoneme conversion for
//! vocal synthesis. It bridges the gap between text input and svara's phoneme
//! sequences — turning "hello world" into synthesizable phoneme events.
//!
//! ## Architecture
//!
//! ```text
//! Input text
//! |
//! v
//! Normalizer (lowercase, expand numbers, handle punctuation)
//! |
//! v
//! Tokenizer (split into words, detect sentence boundaries)
//! |
//! v
//! G2P Engine (dictionary lookup → rule-based fallback)
//! |
//! v
//! Prosody Mapper (stress, intonation from punctuation/syntax)
//! |
//! v
//! Vec<PhonemeEvent> (ready for svara)
//! ```
//!
//! ## Quick Start
//!
//! ```rust
//! use shabda::prelude::*;
//!
//! let g2p = G2PEngine::new(Language::English);
//! let events = g2p.convert("hello world").unwrap();
//! // events is a Vec<svara::sequence::PhonemeEvent> ready for rendering
//! ```
//!
//! ## Feature Flags
//!
//! | Feature | Default | Description |
//! |---------|---------|-------------|
//! | `std` | Yes | Standard library. Disable for `no_std` + `alloc` |
//! | `logging` | No | Structured logging via tracing-subscriber |
//! | `varna` | No | Phoneme inventory validation and language detection via varna |
extern crate alloc;
pub use arpabet;
pub use dictionary;
/// Convenience re-exports for common usage.
// Compile-time trait assertions.