Skip to main content

Recognizer

Trait Recognizer 

Source
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§

Source

fn name(&self) -> &str

Get the name of this recognizer

Source

fn supported_entities(&self) -> &[EntityType]

Get the entity types this recognizer can detect

Source

fn analyze(&self, text: &str, language: &str) -> Result<Vec<RecognizerResult>>

Analyze text and return detected entities

Provided Methods§

Source

fn min_score(&self) -> f32

Get the minimum confidence score for this recognizer

Source

fn supports_language(&self, language: &str) -> bool

Check if this recognizer supports the given language

Implementors§