pub struct GridDoubt {
pub thin_rows: usize,
pub fill: f64,
pub retried_from: usize,
pub full_rows: usize,
pub columns: usize,
}Expand description
What the heuristic table builder had to go on (#574).
The builder knows when it is guessing, and until now it threw that away: the fill ratio was computed and reduced to a pass, and the rest was never recorded. These are the facts it has at the moment it decides, for two consumers – a caller deciding whether to send a page to a vision model (#624), and the learned structure model of #600 deciding whether it may overrule the grid.
NOT COLLAPSED INTO A SCORE, which is why there are five numbers and not one. A weighted worst-of-five would be a hand-made value that reads as a measurement, and nobody could test which part of it was wrong. Each of these is a fact with a unit, and each consumer writes its own rule over them where the rule can be read and argued with. If a scalar is ever wanted, it can be fitted against an outcome and say what it was fitted on.
A PROPERTY OF THE TABLE, not of the cell that carries it. Every cell of one table reports the same value, because a cell is where a model looks and a consumer holding the cells has no other handle on the table they came from.
Fields§
§thin_rows: usizeHow many rows were admitted with too few runs of ink to be a row on their own, through the rule that lets a section head stand inside a table (#576). Each is a row the builder kept on the strength of its neighbours rather than of its own shape.
fill: f64The share of the grid’s cells the page drew ink in, between 0 and 1.
MIN_FILL is the floor a table has to clear, so a grid barely above it is
one the builder nearly refused.
retried_from: usizeWhich attempt produced the grid: 0 for the run’s own first row, 1 or 2 where the first rows had to be trimmed. Above 0 means the first candidate was not a grid.
full_rows: usizeHow many rows have ink in every column, which is what the column boundaries are derived from. A table whose bounds rest on one full row has almost no evidence for where its columns are.
columns: usizeHow many columns the grid has. Every fact above means something different in a two-column table than in a nine-column one, so the scale travels with them rather than being guessed at by the consumer.
Trait Implementations§
impl Copy for GridDoubt
impl StructuralPartialEq for GridDoubt
Auto Trait Implementations§
impl Freeze for GridDoubt
impl RefUnwindSafe for GridDoubt
impl Send for GridDoubt
impl Sync for GridDoubt
impl Unpin for GridDoubt
impl UnsafeUnpin for GridDoubt
impl UnwindSafe for GridDoubt
Blanket Implementations§
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt 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>
ReadEndian::read_from_little_endian().