Documentation
¶
Index ¶
Constants ¶
View Source
const YTolerance = 10
YTolerance is the maximum vertical distance (in pixels) for two blocks to be considered on the same text line / cluster.
Variables ¶
This section is empty.
Functions ¶
func DetectTables ¶
DetectTables returns a Processor that identifies table-like structures where blocks form a grid pattern.
This is a basic heuristic detector. It looks for blocks whose bounding boxes align on both X and Y axes, suggesting a table/cell layout.
func MergeParagraph ¶
MergeParagraph returns a Processor that merges adjacent blocks that are on the same text line (same Y cluster) and close horizontally into a single paragraph block.
func Sort ¶
Sort returns a Processor that sorts blocks into natural reading order. The algorithm:
- Compute the center Y for each block.
- Group blocks whose center Ys are within YTolerance of each other.
- Sort clusters by their average Y (top to bottom).
- Within each cluster, sort blocks by X (left to right).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.