Skip to main content

Module layout_sorting

Module layout_sorting 

Source
Expand description

Enhanced layout sorting logic — xycut_enhanced algorithm.

Faithful port of PaddleX’s xycut_enhanced strategy:

  1. Header/Footer separation
  2. Cross-layout detection (blocks spanning multiple columns)
  3. Direction-aware XY-cut sorting
  4. Overlapping box shrinking before projection
  5. Weighted distance insertion for special blocks
  6. Child block association (vision titles → vision parents)

Structs§

SortableBlock
A wrapper around layout elements with properties needed for sorting.
SortableElement
Input element for enhanced sorting.

Enums§

OrderLabel
Label used for sorting logic.

Functions§

sort_layout_enhanced
Main entry point for enhanced sorting.