Skip to main content

segment_words

Function segment_words 

Source
pub fn segment_words(line: &RgbImage) -> Vec<(u32, u32, u32, u32)>
Expand description

Split a text line into word tokens by a vertical ink-projection profile: runs of ink columns separated by whitespace wider than ~0.6× the line height (an inter-word/-column gap, not an inter-character one). Returns tight (l, 0, r, h) boxes in line-crop pixels. The browser table path recognizes these individually so each word carries its own box for column matching — the native pipeline gets word boxes from the pdfium text layer instead.