[][src]Crate grapheme_to_phoneme

grapheme_to_phoneme is a prediction tool to turn graphemes (words) into Arpabet phonemes.

It is based on Kyubyong Park's and Jongseok Kim's g2p.py, but only focuses on the prediction model (OOV prediction). CMUDict lookup and hetronym handling are best handled by other libraries, such as my Arpabet crate.

Usage:

extern crate grapheme_to_phoneme;
use grapheme_to_phoneme::Model;

let model = Model::load_in_memory()
  .expect("should load");

assert_eq!(model.predict("test").expect("should encode"),
  vec!["T", "EH1", "S", "T"].iter()
    .map(|s| s.to_string())
    .collect::<Vec<String>>());

Structs

Model

Holds the g2p model for repeated evaluations.

Enums

GraphToPhoneError

An error with the library.