pub struct AliasTable { /* private fields */ }Expand description
Table d’alias par domaine : variante normalisée → label canonique normalisé.
Utilisée par le SA avant ingestion pour fusionner les labels équivalents.
La table est définie dans la directive SA — le moteur fournit l’opérateur
de normalisation (normalize_label) mais ne gère pas les alias de domaine.
Exemple d’usage :
use gcn_knowledge::AliasTable;
let mut t = AliasTable::new();
t.insert("auth", "authentification");
t.insert("login", "authentification");
assert_eq!(t.resolve("Login"), "authentification");
assert_eq!(t.resolve("inconnu"), "inconnu");Implementations§
Source§impl AliasTable
impl AliasTable
pub fn new() -> Self
Sourcepub fn insert(&mut self, variant: &str, canonical: &str)
pub fn insert(&mut self, variant: &str, canonical: &str)
Enregistre variant comme alias de canonical (les deux sont normalisés à l’insertion).
Sourcepub fn resolve(&self, label: &str) -> String
pub fn resolve(&self, label: &str) -> String
Résout label vers son canonical normalisé, ou retourne label normalisé si inconnu.
Sourcepub fn is_alias(&self, label: &str) -> bool
pub fn is_alias(&self, label: &str) -> bool
Retourne vrai si label (après normalisation) est un alias connu.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for AliasTable
impl Clone for AliasTable
Source§impl Debug for AliasTable
impl Debug for AliasTable
Auto Trait Implementations§
impl Forget for AliasTable
impl Freeze for AliasTable
impl Move for AliasTable
impl RefUnwindSafe for AliasTable
impl Send for AliasTable
impl Sync for AliasTable
impl Unpin for AliasTable
impl UnsafeUnpin for AliasTable
impl UnwindSafe for AliasTable
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