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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! # Hanzo Extract
//!
//! Content extraction with built-in sanitization via `hanzo-guard`.
//!
//! This crate provides utilities for extracting text content from various sources
//! (web pages, PDFs, etc.) and sanitizing the output for safe use with LLMs.
//!
//! ## Features
//!
//! - **Web Extraction**: Fetch and extract clean text from web pages
//! - **PDF Extraction**: Extract text from PDF documents
//! - **Sanitization**: Automatic PII redaction and injection detection via `hanzo-guard`
//!
//! ## Example
//!
//! ```rust,ignore
//! use hanzo_extract::{WebExtractor, ExtractorConfig};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let extractor = WebExtractor::new(ExtractorConfig::default());
//! let result = extractor.extract("https://example.com").await?;
//! println!("Extracted: {}", result.text);
//! Ok(())
//! }
//! ```
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
//! │ Source │ ──► │ Extractor │ ──► │ Hanzo Guard │
//! │ (URL/PDF) │ │ (Text Parse) │ │ (Sanitization) │
//! └─────────────┘ └──────────────┘ └─────────────────┘
//! │
//! ▼
//! ┌─────────────────┐
//! │ Clean Output │
//! │ (LLM-Ready) │
//! └─────────────────┘
//! ```
pub use ExtractorConfig;
pub use ;
pub use ExtractResult;
pub use WebExtractor;
pub use PdfExtractor;
/// Common trait for all extractors