pub struct RegionSignature {Show 20 fields
pub page_number: u32,
pub region_label: String,
pub x_left: f32,
pub x_right: f32,
pub y_top: f32,
pub y_bottom: f32,
pub area: f32,
pub n_lines: u32,
pub n_visual_lines: u32,
pub median_line_height: f32,
pub n_tokens: u32,
pub italic_tokens: u32,
pub bold_tokens: u32,
pub normal_tokens: u32,
pub glyph_area: f32,
pub density_raw: f32,
pub density: f32,
pub n_peaks: u32,
pub n_peaks_y: u32,
pub y_peak_cv: f32,
}Expand description
Per-region signature. The unit downstream classifiers reason about.
Computed for each leaf of the Region tree from RegionStats.per_page[p].
Interior nodes do not get signatures.
Fields§
§page_number: u32§region_label: StringReading-order path from the Region tree leaf, e.g. “1”, “2-1”,
“3-2-1”. Resolves to the matching leaf in
RegionStats.per_page[…].root.
x_left: f32§x_right: f32§y_top: f32§y_bottom: f32§area: f32(x_right - x_left) × (y_bottom - y_top). Floor-clamped to 1.0.
n_lines: u32Distinct y-rows the leaf’s elements occupy (raw y_top values dedup’d by the same baseline).
n_visual_lines: u32Lines after Y-baseline dedup (sub/superscripts collapsed).
median_line_height: f32Median Y-extent (in pt) of input elements in the leaf. Used as the per-region reference for the visual-line tolerance.
n_tokens: u32§italic_tokens: u32§bold_tokens: u32§normal_tokens: u32§glyph_area: f32Estimated ink-bearing area: Σ per-token chars × font_size² × glyph_width_ratio.
density_raw: f32glyph_area / area. Body prose ≈ 0.4-0.6 typically.
density: f32Per-document normalization: density_raw / max(density_raw across all regions in the document). Lands in [0, 1].
n_peaks: u32X-projection sustained-peak count. ≥ 2 indicates multi-column content (table or list); 1 indicates flowing prose.
n_peaks_y: u32Y-projection presence-based peak count. One peak per visual row in the leaf’s Y-extent.
y_peak_cv: f32Coefficient of variation of inter-Y-peak gaps. 0.0 when < 3 peaks.
Trait Implementations§
Source§impl Clone for RegionSignature
impl Clone for RegionSignature
Source§fn clone(&self) -> RegionSignature
fn clone(&self) -> RegionSignature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more