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
//! Quality heuristics and text analysis
//!
//! This module provides heuristic checks for text quality, including
//! structure analysis and line-level checks.
use *;
use memmem;
// ============================================================================
// Structure Thresholds
// ============================================================================
const MIN_SENTENCE_WORDS: f64 = 10.0;
const MAX_SENTENCE_WORDS: f64 = 30.0;
const MIN_PARAGRAPH_WORDS: f64 = 50.0;
const MAX_PARAGRAPH_WORDS: f64 = 300.0;
// ============================================================================
// Structure Analysis
// ============================================================================
/// Calculate bonus based on text structure quality
pub