pub trait Recognizer:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &str;
fn supported_entities(&self) -> &[EntityType];
fn analyze(
&self,
text: &str,
language: &str,
) -> Result<Vec<RecognizerResult>>;
// Provided methods
fn min_score(&self) -> f32 { ... }
fn supports_language(&self, language: &str) -> bool { ... }
}Expand description
Trait for all PII recognizers
Required Methods§
Sourcefn supported_entities(&self) -> &[EntityType]
fn supported_entities(&self) -> &[EntityType]
Get the entity types this recognizer can detect
Provided Methods§
Sourcefn supports_language(&self, language: &str) -> bool
fn supports_language(&self, language: &str) -> bool
Check if this recognizer supports the given language