Fix the critical 5x3 bordered table test to match acceptance criteria (5 rows × 3 columns = row_ys.len() == 6, col_xs.len() == 4). Add missing unit tests: - test_detect_nested_rectangles: tests handling of nested rectangles - test_detect_disjoint_tables: tests detection of multiple disjoint tables Add Criterion benchmark for table detection performance. Results: ~772 µs for 1000 segments (well under 5 ms requirement). All 35 table module tests pass. Acceptance criteria: - ✅ Detector emits GridCandidate for every closed grid of >= 4 cells - ✅ Critical test: 5x3 bordered table with row_ys.len()==6, col_xs.len()==4 - ✅ Unit tests: single rectangle, nested rectangles, mixed text+rules, glyph-path noise - ✅ Public TableDetector::detect_line_based(&PageContext) -> Vec<GridCandidate> - ✅ Benchmark: < 5 ms on 1000-segment page Refs: pdftract-88sk, plan section 7.2 line 2571 Co-Authored-By: Claude Code <noreply@anthropic.com>
61 lines
1.6 KiB
TOML
61 lines
1.6 KiB
TOML
[package]
|
|
name = "pdftract-core"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish = true
|
|
|
|
[dependencies]
|
|
anyhow = { workspace = true }
|
|
hex = "0.4"
|
|
image = { version = "0.25", optional = true }
|
|
leptonica-plumbing = { version = "1.4", optional = true }
|
|
pdfium-render = { version = "0.9", optional = true }
|
|
indexmap = "2.2"
|
|
flate2 = { workspace = true }
|
|
lzw = { workspace = true }
|
|
regex = "1.10"
|
|
secrecy = { workspace = true }
|
|
serde = { version = "1.0", features = ["derive"], optional = true }
|
|
serde_json = { version = "1.0", optional = true }
|
|
sha2 = "0.10"
|
|
thiserror = { workspace = true }
|
|
memchr = { workspace = true }
|
|
unicode-normalization = { workspace = true }
|
|
ttf-parser = "0.24"
|
|
owned_ttf_parser = "0.21"
|
|
zstd = "0.13"
|
|
rayon = "1.10"
|
|
phf = "0.11"
|
|
tracing = { workspace = true }
|
|
|
|
[features]
|
|
default = ["serde"]
|
|
serde = ["dep:serde", "dep:serde_json"]
|
|
receipts = [] # Enable visual citation receipts (SVG clip generation)
|
|
ocr = ["dep:image", "dep:leptonica-plumbing"] # Enable OCR path (image compositing + preprocessing)
|
|
full-render = ["dep:pdfium-render", "ocr"] # Enable PDFium-based rendering (requires ocr)
|
|
proptest = []
|
|
fuzzing = [] # Enable cfg(fuzzing) for fuzz harnesses
|
|
|
|
[dev-dependencies]
|
|
chrono = "0.4"
|
|
criterion = "0.5"
|
|
proptest = "1.4"
|
|
quick-xml = "0.36"
|
|
regex = "1.10"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
tempfile = "3.10"
|
|
filetime = "0.2"
|
|
|
|
[[bench]]
|
|
name = "table_detection"
|
|
harness = false
|
|
|
|
[build-dependencies]
|
|
phf_codegen = "0.11"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|