Struct arpabet::Arpabet [−][src]
pub struct Arpabet { /* fields omitted */ }
A dictionary that contains mappings of words to polyphones.
Methods
impl Arpabet
[src]
impl Arpabet
pub fn new() -> Arpabet
[src]
pub fn new() -> Arpabet
Create an empty Arpabet.
pub fn load_cmudict() -> &'static Arpabet
[src]
pub fn load_cmudict() -> &'static Arpabet
Loads and caches the CMU Arpabet, which is already present in an unparsed form in memory.
pub fn load_from_str(text: &str) -> Result<Arpabet, ArpabetError>
[src]
pub fn load_from_str(text: &str) -> Result<Arpabet, ArpabetError>
Load a dictionary from text The file format is expected to match that of CMUdict.
pub fn load_from_file(filename: &str) -> Result<Arpabet, ArpabetError>
[src]
pub fn load_from_file(filename: &str) -> Result<Arpabet, ArpabetError>
Load a dictionary from file The file format is expected to match that of CMUdict.
pub fn get_polyphone_ref(&self, word: &str) -> Option<&Polyphone>
[src]
pub fn get_polyphone_ref(&self, word: &str) -> Option<&Polyphone>
Get a polyphone from the dictionary.
pub fn get_polyphone(&self, word: &str) -> Option<Polyphone>
[src]
pub fn get_polyphone(&self, word: &str) -> Option<Polyphone>
Get a polyphone from the dictionary.
pub fn combine(&self, other: &Arpabet) -> Arpabet
[src]
pub fn combine(&self, other: &Arpabet) -> Arpabet
Combine two Arpabets and return the result. Items in the second Arpabet take precedence.
pub fn merge_from(&mut self, other: &Arpabet)
[src]
pub fn merge_from(&mut self, other: &Arpabet)
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: Polyphone) -> Option<Polyphone>
[src]
pub fn insert(&mut self, key: Word, value: Polyphone) -> Option<Polyphone>
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<Polyphone>
[src]
pub fn remove(&mut self, key: &str) -> Option<Polyphone>
Remove an entry from the arpabet. If it is present, it will be returned.
ⓘImportant traits for Keys<'a, K, V>pub fn keys(&self) -> Keys<String, Polyphone>
[src]
pub fn keys(&self) -> Keys<String, Polyphone>
Return a keys iterator that walks the keys in random order.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Reports the number of entries in the arpabet.