pub struct WordConfidence {
pub word: String,
pub confidence: f64,
pub x_offset: f64,
pub width: f64,
pub character_confidences: Option<Vec<CharacterConfidence>>,
}Expand description
Word-level confidence information for detailed OCR analysis
Fields§
§word: StringThe word text
confidence: f64Confidence score for this specific word (0.0 to 1.0)
x_offset: f64X position of the word within the fragment (relative to fragment start)
width: f64Width of the word in points
character_confidences: Option<Vec<CharacterConfidence>>Optional character-level confidences (for ultimate granularity)
Implementations§
Source§impl WordConfidence
impl WordConfidence
Sourcepub fn new(word: String, confidence: f64, x_offset: f64, width: f64) -> Self
pub fn new(word: String, confidence: f64, x_offset: f64, width: f64) -> Self
Create a new word confidence
Sourcepub fn with_characters(
word: String,
confidence: f64,
x_offset: f64,
width: f64,
character_confidences: Vec<CharacterConfidence>,
) -> Self
pub fn with_characters( word: String, confidence: f64, x_offset: f64, width: f64, character_confidences: Vec<CharacterConfidence>, ) -> Self
Create a word confidence with character-level details
Sourcepub fn average_character_confidence(&self) -> Option<f64>
pub fn average_character_confidence(&self) -> Option<f64>
Get the average character confidence if available
Sourcepub fn is_low_confidence(&self, threshold: f64) -> bool
pub fn is_low_confidence(&self, threshold: f64) -> bool
Check if this word has low confidence (below threshold)
Trait Implementations§
Source§impl Clone for WordConfidence
impl Clone for WordConfidence
Source§fn clone(&self) -> WordConfidence
fn clone(&self) -> WordConfidence
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WordConfidence
impl RefUnwindSafe for WordConfidence
impl Send for WordConfidence
impl Sync for WordConfidence
impl Unpin for WordConfidence
impl UnsafeUnpin for WordConfidence
impl UnwindSafe for WordConfidence
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