Skip to main content

TableFinder

Struct TableFinder 

Source
pub struct TableFinder { /* private fields */ }
Expand description

Orchestrator for the table detection pipeline.

Takes edges (and optionally words/chars) and settings, then runs the appropriate detection strategy to produce tables.

Implementations§

Source§

impl TableFinder

Source

pub fn new(edges: Vec<Edge>, settings: TableSettings) -> Self

Create a new TableFinder with the given edges and settings.

Source

pub fn new_with_words( edges: Vec<Edge>, words: Vec<Word>, settings: TableSettings, ) -> Self

Create a new TableFinder with edges, words, and settings.

The words are used by the Stream strategy to generate synthetic edges from text alignment patterns.

Source

pub fn settings(&self) -> &TableSettings

Get a reference to the settings.

Source

pub fn edges(&self) -> &[Edge]

Get a reference to the edges.

Source

pub fn find_tables(&self) -> Vec<Table>

Run the table detection pipeline and return detected tables.

Pipeline: filter edges → snap → join → intersections → cells → tables.

For Lattice strategy, all edges (lines + rect edges) are used. For LatticeStrict strategy, only line-sourced edges are used (no rect edges). For Stream strategy, synthetic edges are generated from word alignment patterns. For Explicit strategy, edges from user-provided coordinates are used, combined with any detected edges passed to the finder (mixing).

Source

pub fn find_tables_debug(&self) -> TableFinderDebug

Run the table detection pipeline and return intermediate results for debugging.

Returns a TableFinderDebug containing the processed edges, intersections, cells, and tables from each pipeline stage. This is used by the visual debugging system to render the table detection process.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.