pub struct RegexClassifier { /* private fields */ }Expand description
Regex-based classifier
Implementations§
Source§impl RegexClassifier
impl RegexClassifier
Sourcepub fn new(
rules: &[ClassificationRule],
default_level: SensitivityLevel,
) -> Result<Self, PrivacyError>
pub fn new( rules: &[ClassificationRule], default_level: SensitivityLevel, ) -> Result<Self, PrivacyError>
Create a new classifier with the given rules
Sourcepub fn classify(&self, text: &str) -> ClassificationResult
pub fn classify(&self, text: &str) -> ClassificationResult
Classify text and return matches
Sourcepub fn redact(&self, text: &str, strategy: RedactionStrategy) -> String
pub fn redact(&self, text: &str, strategy: RedactionStrategy) -> String
Redact sensitive data in text
Sourcepub fn contains_sensitive(&self, text: &str) -> bool
pub fn contains_sensitive(&self, text: &str) -> bool
Check if text contains sensitive data
Sourcepub fn get_sensitivity_level(&self, text: &str) -> SensitivityLevel
pub fn get_sensitivity_level(&self, text: &str) -> SensitivityLevel
Get the highest sensitivity level in text
Auto Trait Implementations§
impl Freeze for RegexClassifier
impl RefUnwindSafe for RegexClassifier
impl Send for RegexClassifier
impl Sync for RegexClassifier
impl Unpin for RegexClassifier
impl UnsafeUnpin for RegexClassifier
impl UnwindSafe for RegexClassifier
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