pub struct HashMapLexicon { /* private fields */ }Expand description
Simple HashMap-based lexicon implementation.
Suitable for small to medium lexicons (<100k entries). For larger lexicons, consider a trie-based or FST implementation.
Implementations§
Source§impl HashMapLexicon
impl HashMapLexicon
Sourcepub fn new(source: impl Into<String>) -> Self
pub fn new(source: impl Into<String>) -> Self
Create a new empty lexicon with the given source identifier.
Sourcepub fn insert(
&mut self,
text: impl Into<String>,
entity_type: EntityType,
confidence: f64,
)
pub fn insert( &mut self, text: impl Into<String>, entity_type: EntityType, confidence: f64, )
Insert an entry into the lexicon.
Trait Implementations§
Source§impl Clone for HashMapLexicon
impl Clone for HashMapLexicon
Source§fn clone(&self) -> HashMapLexicon
fn clone(&self) -> HashMapLexicon
Returns a duplicate of the value. Read more
1.0.0 · 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 HashMapLexicon
impl Debug for HashMapLexicon
Auto Trait Implementations§
impl Freeze for HashMapLexicon
impl RefUnwindSafe for HashMapLexicon
impl Send for HashMapLexicon
impl Sync for HashMapLexicon
impl Unpin for HashMapLexicon
impl UnsafeUnpin for HashMapLexicon
impl UnwindSafe for HashMapLexicon
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