pub struct Lexicon { /* private fields */ }Expand description
Bidirectional token↔concept index over [CONCEPT_CLUSTERS].
Implementations§
Source§impl Lexicon
impl Lexicon
pub fn new() -> Self
Sourcepub fn concepts_for(&self, token: &str) -> &[&'static str]
pub fn concepts_for(&self, token: &str) -> &[&'static str]
Concepts a token belongs to, if any.
Sourcepub fn expand(&self, token: &str) -> HashSet<String>
pub fn expand(&self, token: &str) -> HashSet<String>
Every token related to the given one, including itself.
login → auth, authenticate, session, token, …
Whether two tokens share a concept.
Sourcepub fn concept_count(&self) -> usize
pub fn concept_count(&self) -> usize
Number of concept clusters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lexicon
impl RefUnwindSafe for Lexicon
impl Send for Lexicon
impl Sync for Lexicon
impl Unpin for Lexicon
impl UnsafeUnpin for Lexicon
impl UnwindSafe for Lexicon
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