Struct cmudict_fast::Cmudict [−][src]
A dictionary containing words & their pronunciations
Implementations
impl Cmudict
[src]
pub fn new<P: AsRef<Path>>(dict: P) -> Result<Cmudict>
[src]
Takes a path to a cmudict file and tries to construct a Cmudict
struct
Example
use cmudict_fast as cmudict; use cmudict::Cmudict; let dict = Cmudict::new("./resources/cmudict.dict")?;
pub fn get(&self, s: &str) -> Option<&[Rule]>
[src]
Look for a word in the dictionary, and retrieve it’s pronunciation
Example
use cmudict_fast as cmudict; use cmudict::{Cmudict, Symbol, Stress}; let dict = Cmudict::new("./resources/cmudict.dict")?; let rust = dict.get("rust"); assert!(rust.is_some()); assert_eq!( rust.unwrap().first().unwrap().pronunciation(), &[Symbol::R, Symbol::AH(Stress::Primary), Symbol::S, Symbol::T] );
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cmudict
impl Send for Cmudict
impl Sync for Cmudict
impl Unpin for Cmudict
impl UnwindSafe for Cmudict
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,