pii 0.1.0

PII detection and anonymization with deterministic, capability-aware NLP pipelines.
Documentation
use pii::nlp::SimpleNlpEngine;
use pii::presets::default_recognizers;
use pii::{Analyzer, PolicyConfig};
use pii::types::Language;

fn main() {
    let analyzer = Analyzer::new(
        Box::new(SimpleNlpEngine::default()),
        default_recognizers(),
        Vec::new(),
        PolicyConfig::default(),
    );

    let text = "Email jane@example.com from 10.0.0.5.";
    let result = analyzer.analyze(text, &Language::from("en")).unwrap();

    for detection in &result.entities {
        let span = &text[detection.start..detection.end];
        println!(
            "type={} start={} end={} value={}",
            detection.entity_type.as_str(),
            detection.start,
            detection.end,
            span
        );
    }
}