pii 0.1.0

PII detection and anonymization with deterministic, capability-aware NLP pipelines.
Documentation
//! Error types for the PII library.
//!
//! Errors are grouped by pipeline stage so callers can distinguish:
//! - invalid configuration or profiles
//! - NLP engine failures
//! - recognizer failures
//! - anonymizer failures
//!
//! This keeps error handling explicit and avoids hidden fallbacks.

use thiserror::Error;

/// Errors returned by the PII pipeline.
#[derive(Debug, Error)]
pub enum PiiError {
    /// Invalid or incomplete language profile.
    #[error("invalid language profile: {0}")]
    InvalidProfile(String),
    /// NLP engine failure.
    #[error("nlp engine error: {0}")]
    NlpEngine(String),
    /// Recognizer-level failure.
    #[error("recognizer error: {0}")]
    Recognizer(String),
    /// Anonymizer failure (e.g., invalid offsets).
    #[error("anonymizer error: {0}")]
    Anonymizer(String),
}

/// Result alias for PII operations.
pub type PiiResult<T> = Result<T, PiiError>;