Skip to main content

dataprof_core/
pattern.rs

1use crate::classification::PatternCategory;
2
3/// A detected value pattern within a column (e.g. email, phone, UUID).
4#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
5pub struct Pattern {
6    /// Pattern name (e.g. "Email", "Phone (US)", "UUID")
7    pub name: String,
8    /// Regex used for detection
9    pub regex: String,
10    /// Number of values matching this pattern
11    pub match_count: usize,
12    /// Percentage of non-null values matching (0.0--100.0)
13    pub match_percentage: f64,
14    /// Semantic category (e.g. contact, network, financial)
15    pub category: PatternCategory,
16    /// Detection confidence score (0.0--1.0), derived from pattern specificity and match rate
17    pub confidence: f64,
18}