pub struct SemanticTextNode {Show 15 fields
pub bbox: BoundingBox,
pub index: Option<u32>,
pub level: Option<String>,
pub semantic_type: SemanticType,
pub correct_semantic_score: Option<f64>,
pub columns: Vec<TextColumn>,
pub font_weight: Option<f64>,
pub font_size: Option<f64>,
pub text_color: Option<Vec<f64>>,
pub italic_angle: Option<f64>,
pub font_name: Option<String>,
pub text_format: Option<TextFormat>,
pub max_font_size: Option<f64>,
pub background_color: Option<Vec<f64>>,
pub is_hidden_text: bool,
}Expand description
Base for all text-bearing semantic elements.
Fields§
§bbox: BoundingBoxBounding box
index: Option<u32>Global index
level: Option<String>Nesting level
semantic_type: SemanticTypeSemantic classification
correct_semantic_score: Option<f64>Confidence score for semantic classification
columns: Vec<TextColumn>Text columns
font_weight: Option<f64>Dominant font weight
font_size: Option<f64>Dominant font size
text_color: Option<Vec<f64>>Dominant text color — original PDF color components (1=Gray, 3=RGB, 4=CMYK)
italic_angle: Option<f64>Italic angle
font_name: Option<String>Font name
text_format: Option<TextFormat>Text format
max_font_size: Option<f64>Maximum font size in this node
background_color: Option<Vec<f64>>Background color — original PDF color components (1=Gray, 3=RGB, 4=CMYK)
Whether all text is hidden
Implementations§
Source§impl SemanticTextNode
impl SemanticTextNode
Sourcepub fn lines_number(&self) -> usize
pub fn lines_number(&self) -> usize
Number of text lines across all columns.
Sourcepub fn columns_number(&self) -> usize
pub fn columns_number(&self) -> usize
Number of columns.
Sourcepub fn is_space_node(&self) -> bool
pub fn is_space_node(&self) -> bool
Whether this node contains only whitespace.
Sourcepub fn starts_with_arabic_number(&self) -> bool
pub fn starts_with_arabic_number(&self) -> bool
Whether the text starts with an Arabic (decimal) number.
Trait Implementations§
Source§impl Clone for SemanticTextNode
impl Clone for SemanticTextNode
Source§fn clone(&self) -> SemanticTextNode
fn clone(&self) -> SemanticTextNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticTextNode
impl Debug for SemanticTextNode
Source§impl<'de> Deserialize<'de> for SemanticTextNode
impl<'de> Deserialize<'de> for SemanticTextNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SemanticTextNode
impl RefUnwindSafe for SemanticTextNode
impl Send for SemanticTextNode
impl Sync for SemanticTextNode
impl Unpin for SemanticTextNode
impl UnsafeUnpin for SemanticTextNode
impl UnwindSafe for SemanticTextNode
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more