23 #ifndef TESSERACT_TRAINING_BOXCHAR_H_ 24 #define TESSERACT_TRAINING_BOXCHAR_H_ 29 #include "allheaders.h" 38 BoxChar(
const char* utf8_str,
int len);
43 const std::string&
ch()
const {
return ch_; }
44 const Box*
box()
const {
return box_; }
45 const int&
page()
const {
return page_; }
50 void AddBox(
int x,
int y,
int width,
int height);
60 if (box_ ==
nullptr)
return true;
61 if (other.box_ ==
nullptr)
return false;
62 return box_->x < other.box_->x;
72 std::vector<BoxChar*>* boxes);
79 std::vector<BoxChar*>* boxes);
82 static void InsertSpaces(
bool rtl_rules,
bool vertical_rules,
83 std::vector<BoxChar*>* boxes);
101 std::vector<BoxChar*>* boxes);
106 const std::vector<BoxChar*>& boxes);
110 const std::vector<BoxChar*>& boxes);
126 return *box1 < *box2;
132 #endif // TESSERACT_TRAINING_BOXCHAR_H_ std::string * mutable_ch()
static void PrepareToWrite(std::vector< BoxChar *> *boxes)
void set_rtl_index(int index)
const std::string & ch() const
static void TranslateBoxes(int xshift, int yshift, std::vector< BoxChar *> *boxes)
bool operator<(const BoxChar &other) const
static bool MostlyVertical(const std::vector< BoxChar *> &boxes)
void AddBox(int x, int y, int width, int height)
static void ReorderRTLText(std::vector< BoxChar *> *boxes)
static std::string GetTesseractBoxStr(int height, const std::vector< BoxChar *> &boxes)
static void InsertNewlines(bool rtl_rules, bool vertical_rules, std::vector< BoxChar *> *boxes)
void ReverseUnicodesInBox()
static void WriteTesseractBoxFile(const std::string &name, int height, const std::vector< BoxChar *> &boxes)
void GetDirection(int *num_rtl, int *num_ltr) const
static int TotalByteLength(const std::vector< BoxChar *> &boxes)
const int & rtl_index() const
BoxChar(const char *utf8_str, int len)
static void RotateBoxes(float rotation, int xcenter, int ycenter, int start_box, int end_box, std::vector< BoxChar *> *boxes)
static void InsertSpaces(bool rtl_rules, bool vertical_rules, std::vector< BoxChar *> *boxes)
static bool ContainsMostlyRTL(const std::vector< BoxChar *> &boxes)
bool operator()(const BoxChar *box1, const BoxChar *box2) const