pub struct SpanMergingDebugger {
pub current_page: usize,
pub gap_decisions: Vec<GapDecision>,
pub threshold_computations: Vec<ThresholdComputation>,
pub page_stats: Vec<PageGapStats>,
pub total_spaces_inserted: usize,
pub spaces_by_adaptive: usize,
pub spaces_by_heuristic: usize,
pub spaces_by_both: usize,
}Available on crate feature
debug-span-merging only.Expand description
Debugger for span merging analysis.
Collects detailed information about each span merging decision and generates formatted reports.
Fields§
§current_page: usizeCurrent page being processed
gap_decisions: Vec<GapDecision>Gap decisions for current page
threshold_computations: Vec<ThresholdComputation>Threshold computations per page
page_stats: Vec<PageGapStats>Gap statistics per page
total_spaces_inserted: usizeTotal spaces inserted
spaces_by_adaptive: usizeSpaces inserted by adaptive threshold
spaces_by_heuristic: usizeSpaces inserted by heuristic
spaces_by_both: usizeSpaces inserted by both
Implementations§
Source§impl SpanMergingDebugger
impl SpanMergingDebugger
Sourcepub fn record_threshold(
&mut self,
config_name: &str,
multiplier: f32,
min_threshold: f32,
max_threshold: f32,
median_gap: f32,
computed_raw: f32,
computed_final: f32,
used_bimodal: bool,
reason: &str,
)
pub fn record_threshold( &mut self, config_name: &str, multiplier: f32, min_threshold: f32, max_threshold: f32, median_gap: f32, computed_raw: f32, computed_final: f32, used_bimodal: bool, reason: &str, )
Record a threshold computation.
Sourcepub fn record_page_stats(&mut self, stats: PageGapStats)
pub fn record_page_stats(&mut self, stats: PageGapStats)
Record page gap statistics.
Sourcepub fn record_gap_decision(
&mut self,
gap_index: usize,
left_text: &str,
right_text: &str,
gap_pt: f32,
font_size: f32,
space_threshold_pt: f32,
adaptive_threshold_pt: f32,
needs_space_by_gap: bool,
needs_space_by_heuristic: bool,
needs_space_by_adaptive: bool,
space_inserted: bool,
)
pub fn record_gap_decision( &mut self, gap_index: usize, left_text: &str, right_text: &str, gap_pt: f32, font_size: f32, space_threshold_pt: f32, adaptive_threshold_pt: f32, needs_space_by_gap: bool, needs_space_by_heuristic: bool, needs_space_by_adaptive: bool, space_inserted: bool, )
Record a gap decision.
Sourcepub fn generate_page_report(&self, page_num: usize) -> String
pub fn generate_page_report(&self, page_num: usize) -> String
Generate formatted report for a specific page.
Sourcepub fn generate_summary(&self) -> String
pub fn generate_summary(&self) -> String
Generate summary report.
Trait Implementations§
Source§impl Debug for SpanMergingDebugger
impl Debug for SpanMergingDebugger
Source§impl Default for SpanMergingDebugger
impl Default for SpanMergingDebugger
Source§fn default() -> SpanMergingDebugger
fn default() -> SpanMergingDebugger
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpanMergingDebugger
impl RefUnwindSafe for SpanMergingDebugger
impl Send for SpanMergingDebugger
impl Sync for SpanMergingDebugger
impl Unpin for SpanMergingDebugger
impl UnsafeUnpin for SpanMergingDebugger
impl UnwindSafe for SpanMergingDebugger
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.