tesseract v5.3.3.20231005
tesseract::ShapeRating Struct Reference

#include <shapetable.h>

Public Member Functions

 ShapeRating ()
 
 ShapeRating (int s, float r)
 

Static Public Member Functions

static int FirstResultWithUnichar (const std::vector< ShapeRating > &results, const ShapeTable &shape_table, UNICHAR_ID unichar_id)
 

Public Attributes

int shape_id
 
float rating
 
float raw
 
float font
 
bool joined
 
bool broken
 

Detailed Description

Definition at line 76 of file shapetable.h.

Constructor & Destructor Documentation

◆ ShapeRating() [1/2]

tesseract::ShapeRating::ShapeRating ( )
inline

Definition at line 77 of file shapetable.h.

◆ ShapeRating() [2/2]

tesseract::ShapeRating::ShapeRating ( int  s,
float  r 
)
inline

Definition at line 78 of file shapetable.h.

79 : shape_id(s), rating(r), raw(1.0f), font(0.0f), joined(false), broken(false) {}

Member Function Documentation

◆ FirstResultWithUnichar()

int tesseract::ShapeRating::FirstResultWithUnichar ( const std::vector< ShapeRating > &  results,
const ShapeTable shape_table,
UNICHAR_ID  unichar_id 
)
static

Definition at line 38 of file shapetable.cpp.

39 {
40 for (unsigned r = 0; r < results.size(); ++r) {
41 const auto shape_id = results[r].shape_id;
42 const Shape &shape = shape_table.GetShape(shape_id);
43 if (shape.ContainsUnichar(unichar_id)) {
44 return r;
45 }
46 }
47 return -1;
48}

Member Data Documentation

◆ broken

bool tesseract::ShapeRating::broken

Definition at line 100 of file shapetable.h.

◆ font

float tesseract::ShapeRating::font

Definition at line 96 of file shapetable.h.

◆ joined

bool tesseract::ShapeRating::joined

Definition at line 98 of file shapetable.h.

◆ rating

float tesseract::ShapeRating::rating

Definition at line 92 of file shapetable.h.

◆ raw

float tesseract::ShapeRating::raw

Definition at line 94 of file shapetable.h.

◆ shape_id

int tesseract::ShapeRating::shape_id

Definition at line 89 of file shapetable.h.


The documentation for this struct was generated from the following files: