pub struct SynonymExpander { /* private fields */ }Expand description
Synonym expansion table. Groups of semantically equivalent terms. FM-SEM-002 fix: no overlapping terms across groups (transitive closure prevented). Uses String-based lookups (not InternedStr) to avoid orphan interner bug.
Implementations§
Source§impl SynonymExpander
impl SynonymExpander
Sourcepub fn build_default() -> M1ndResult<Self>
pub fn build_default() -> M1ndResult<Self>
Build from the built-in SYNONYM_GROUPS constant. Validates no term appears in multiple groups (FM-SEM-002). Replaces: semantic_v2.py SynonymExpander.init()
Sourcepub fn build(groups: Vec<Vec<&str>>) -> M1ndResult<Self>
pub fn build(groups: Vec<Vec<&str>>) -> M1ndResult<Self>
Build from custom synonym groups. Uses String-based lookup (no interner needed).
Sourcepub fn expand(&self, term: &str) -> Vec<String>
pub fn expand(&self, term: &str) -> Vec<String>
Expand a term to all synonyms (including itself). Replaces: semantic_v2.py SynonymExpander.expand()
Sourcepub fn are_synonyms(&self, a: &str, b: &str) -> bool
pub fn are_synonyms(&self, a: &str, b: &str) -> bool
Check if two terms are synonymous.
Auto Trait Implementations§
impl Freeze for SynonymExpander
impl RefUnwindSafe for SynonymExpander
impl Send for SynonymExpander
impl Sync for SynonymExpander
impl Unpin for SynonymExpander
impl UnsafeUnpin for SynonymExpander
impl UnwindSafe for SynonymExpander
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