[−][src]Struct arpabet_types::Arpabet
A dictionary that contains mappings of words to polyphones.
Implementations
impl Arpabet
[src]
pub fn new() -> Arpabet
[src]
Create an empty Arpabet.
pub fn from_map(map: HashMap<Word, Polyphone>) -> Self
[src]
Create an Arpabet from a map. Consumes the map.
pub fn from_phf_map(map: &Map<&str, &[Phoneme]>) -> Self
[src]
Create an Arpabet from a phf::Map. Used internally for allocation from codegen. Unfortunately this needs to allocate a new HashMap and copy data over.
pub fn get_polyphone(&self, word: &str) -> Option<Polyphone>
[src]
Get a polyphone from the dictionary.
pub fn get_polyphone_ref(&self, word: &str) -> Option<&Polyphone>
[src]
Get a polyphone from the dictionary.
pub fn get_polyphone_str(&self, word: &str) -> Option<Vec<&'static str>>
[src]
Get a polyphone from the dictionary.
pub fn combine(&self, other: &Arpabet) -> Arpabet
[src]
Combine two Arpabets and return the result. Items in the second Arpabet take precedence.
pub fn merge_from(&mut self, other: &Arpabet)
[src]
Merge the supplied Arpabet into the current one. Items in the supplied Arpabet override existing entries should they already exist.
pub fn insert(&mut self, key: Word, value: Vec<Phoneme>) -> Option<Vec<Phoneme>>
[src]
Insert an entry into the Arpabet. If the entry is already present, replace it and return the old value.
pub fn remove(&mut self, key: &str) -> Option<Vec<Phoneme>>
[src]
Remove an entry from the arpabet. If it is present, it will be returned.
pub fn keys(&self) -> Keys<'_, String, Vec<Phoneme>>
[src]
Return a keys iterator that walks the keys in random order.
pub fn len(&self) -> usize
[src]
Reports the number of entries in the arpabet.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Arpabet
impl Send for Arpabet
impl Sync for Arpabet
impl Unpin for Arpabet
impl UnwindSafe for Arpabet
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,