1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Core types and scanning primitives for cloakrs.
//!
//! `cloakrs-core` contains the public data model, recognizer trait,
//! registry, scanner, and masking strategy implementations shared by the
//! rest of the workspace.
//!
//! # Examples
//!
//! ```
//! use cloakrs_core::{Confidence, EntityType, Locale, PiiEntity, Recognizer, Scanner, Span};
//!
//! struct Email;
//! impl Recognizer for Email {
//! fn id(&self) -> &str { "email_example_v1" }
//! fn entity_type(&self) -> EntityType { EntityType::Email }
//! fn supported_locales(&self) -> &[Locale] { &[] }
//! fn scan(&self, text: &str) -> Vec<PiiEntity> {
//! text.find('@').map(|_| PiiEntity {
//! entity_type: EntityType::Email,
//! span: Span::new(0, text.len()),
//! text: text.to_string(),
//! confidence: Confidence::new(0.9).unwrap(),
//! recognizer_id: self.id().to_string(),
//! }).into_iter().collect()
//! }
//! }
//!
//! let scanner = Scanner::builder().recognizer(Email).build().unwrap();
//! let result = scanner.scan("jane@example.com").unwrap();
//! assert_eq!(result.masked_text.as_deref(), Some("[EMAIL]"));
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;