Skip to main content

Module table

Module table 

Source
Expand description

Heuristic table detection (merged from easypdf-markdown-table). 用于 PDF 转 Markdown 的启发式表格检测。

本模块提供 TableDetectorProcessor,它是 PdfMarkdownProcessor 的一个实现, 扫描段落块中的表格模式并将其替换为 PdfBlock::Table 块。

§支持的模式

模式示例分隔符
管道| Name | Age || 字符
制表符Name\tAge制表符
空格Name Age City2 个以上连续空格

§快速开始

use easypdf_markdown::{ProcessorPipeline, PdfMarkdownProcessor};
use easypdf_markdown::table::TableDetectorProcessor;

let mut pipeline = ProcessorPipeline::new();
pipeline.register(Box::new(TableDetectorProcessor::new()));

§配置

使用 TableDetectionConfig 调整:

  • 最小行/列数
  • 列分隔策略(Pipe、Tab、Whitespace 或 Auto)
  • 是否允许不规则列数

Re-exports§

pub use config::ColumnSeparator;
pub use config::TableDetectionConfig;

Modules§

config
表格检测配置。

Structs§

TableDetectorProcessor
启发式表格检测处理器。