pub struct TableDetectorProcessor { /* private fields */ }Expand description
启发式表格检测处理器。
扫描每个页面的 PdfBlock::Paragraph 块,查找表格模式
(管道分隔、制表符分隔或空格对齐),并将连续匹配的行
替换为单个 PdfBlock::Table。
检测到的区域的第一行成为表头;其余行成为数据行。
分隔行(如 |---|---|)会被自动跳过。
§能力等级
此处理器声明 CapabilityLevel::Heuristic
的表格检测能力——纯粹基于文本模式工作,不检查 PDF 矢量图形或字体度量。
§Examples
use easypdf_markdown::PdfMarkdownProcessor;
use easypdf_markdown::table::TableDetectorProcessor;
let proc = TableDetectorProcessor::new();
assert!(proc.capabilities().table_detection());Implementations§
Source§impl TableDetectorProcessor
impl TableDetectorProcessor
Sourcepub fn with_config(config: TableDetectionConfig) -> Self
pub fn with_config(config: TableDetectionConfig) -> Self
使用自定义配置创建处理器。
Trait Implementations§
Source§impl Clone for TableDetectorProcessor
impl Clone for TableDetectorProcessor
Source§fn clone(&self) -> TableDetectorProcessor
fn clone(&self) -> TableDetectorProcessor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableDetectorProcessor
impl Debug for TableDetectorProcessor
Source§impl Default for TableDetectorProcessor
impl Default for TableDetectorProcessor
Source§impl PdfMarkdownProcessor for TableDetectorProcessor
impl PdfMarkdownProcessor for TableDetectorProcessor
Source§fn capabilities(&self) -> MarkdownProcessorCapabilities
fn capabilities(&self) -> MarkdownProcessorCapabilities
返回处理器能够真正提供的能力。
Source§fn process(
&self,
_input: &PdfInput,
document: PdfDocumentModel,
) -> Result<(PdfDocumentModel, Vec<MarkdownWarning>)>
fn process( &self, _input: &PdfInput, document: PdfDocumentModel, ) -> Result<(PdfDocumentModel, Vec<MarkdownWarning>)>
增强语义模型并返回本处理器产生的非致命警告。 Read more
Auto Trait Implementations§
impl Freeze for TableDetectorProcessor
impl RefUnwindSafe for TableDetectorProcessor
impl Send for TableDetectorProcessor
impl Sync for TableDetectorProcessor
impl Unpin for TableDetectorProcessor
impl UnsafeUnpin for TableDetectorProcessor
impl UnwindSafe for TableDetectorProcessor
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more