Skip to main content

Module xycut

Module xycut 

Source
Expand description

XY-Cut++ reading order algorithm.

  ┌──────────────────────────┐
  │  Col A      │   Col B    │
  │  ┌────────┐ │ ┌────────┐ │
  │  │ Para 1 │ │ │ Para 3 │ │    1. Find largest vertical gap
  │  └────────┘ │ └────────┘ │       → split left / right
  │  ┌────────┐ │ ┌────────┐ │    2. Recurse on each half
  │  │ Para 2 │ │ │ Para 4 │ │    3. Within half: find horizontal gap
  │  └────────┘ │ └────────┘ │       → split top / bottom
  └──────────────────────────┘    4. Order: top→bottom, left→right

  Result: Para 1, Para 2, Para 3, Para 4

Functions§

xycut_sort
Sort content elements using the XY-Cut++ algorithm.