pub struct DictionaryBundle { /* private fields */ }Expand description
Value-only dictionary bundle shared with recognizers.
Implementations§
Source§impl DictionaryBundle
impl DictionaryBundle
Sourcepub fn from_rulepack_terms(terms: &[RulepackDict]) -> Self
pub fn from_rulepack_terms(terms: &[RulepackDict]) -> Self
Builds a bundle from rulepack dictionaries.
Sourcepub fn from_entries(
entries: impl IntoIterator<Item = (String, DictionaryEntry)>,
) -> Self
pub fn from_entries( entries: impl IntoIterator<Item = (String, DictionaryEntry)>, ) -> Self
Builds a bundle from pre-built dictionary entries.
Sourcepub fn merge(a: Self, b: Self) -> Self
pub fn merge(a: Self, b: Self) -> Self
Merges two bundles, preferring entries from the second bundle on name conflicts.
Sourcepub fn get(&self, name: &str) -> Option<&DictionaryEntry>
pub fn get(&self, name: &str) -> Option<&DictionaryEntry>
Returns a dictionary by name.
Sourcepub fn stats(&self) -> Vec<DictionaryStats>
pub fn stats(&self) -> Vec<DictionaryStats>
Returns sorted dictionary stats.
Trait Implementations§
Source§impl Clone for DictionaryBundle
impl Clone for DictionaryBundle
Source§fn clone(&self) -> DictionaryBundle
fn clone(&self) -> DictionaryBundle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DictionaryBundle
impl Debug for DictionaryBundle
Source§impl Default for DictionaryBundle
impl Default for DictionaryBundle
Source§fn default() -> DictionaryBundle
fn default() -> DictionaryBundle
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DictionaryBundle
impl RefUnwindSafe for DictionaryBundle
impl Send for DictionaryBundle
impl Sync for DictionaryBundle
impl Unpin for DictionaryBundle
impl UnsafeUnpin for DictionaryBundle
impl UnwindSafe for DictionaryBundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more