Skip to main content

Crate shabdakosh

Crate shabdakosh 

Source
Expand description

§shabdakosh — Pronunciation Dictionary

shabdakosh (Sanskrit: dictionary) provides pronunciation dictionaries mapping words to svara Phoneme sequences.

§Features

  • 10,000+ entry English dictionary generated at compile time from CMUdict
  • ARPABET mapping — bidirectional conversion between ARPABET and svara phonemes
  • User overlay — application-specific entries that override the base dictionary
  • Import/export — CMUdict text format and JSON (with json feature)

§Quick Start

use shabdakosh::PronunciationDict;

let dict = PronunciationDict::english();
assert!(dict.lookup("hello").is_some());
assert!(dict.len() >= 10000);

§Feature Flags

FeatureDefaultDescription
stdYesStandard library. Disable for no_std + alloc
jsonNoJSON import/export via serde_json
varnaNoMulti-language support: inventory validation, lexicon ingestion, script detection

Re-exports§

pub use dictionary::coverage::CoverageReport;
pub use dictionary::entry::DictEntry;
pub use dictionary::entry::Pronunciation;
pub use dictionary::entry::Region;
pub use dictionary::g2p::FallbackDict;
pub use dictionary::g2p::G2PModel;
pub use dictionary::g2p::G2PResult;
pub use dictionary::g2p::LookupSource;
pub use dictionary::stream::LookupStream;
pub use dictionary::trie::PrefixTrie;
pub use dictionary::DictDiff;
pub use dictionary::PronunciationDict;
pub use error::Result;
pub use error::ShabdakoshError;

Modules§

arpabet
ARPABET-to-svara phoneme mapping.
dictionary
Pronunciation dictionary for common/irregular words.
error
Error types for the shabdakosh crate.
ipa
IPA (International Phonetic Alphabet) to svara phoneme mapping.
notation
Unified phoneme notation abstraction.