#include <ocrpara.h>
|
| ParagraphModel (tesseract::ParagraphJustification justification, int margin, int first_indent, int body_indent, int tolerance) |
|
| ParagraphModel () |
|
bool | ValidFirstLine (int lmargin, int lindent, int rindent, int rmargin) const |
|
bool | ValidBodyLine (int lmargin, int lindent, int rindent, int rmargin) const |
|
tesseract::ParagraphJustification | justification () const |
|
int | margin () const |
|
int | first_indent () const |
|
int | body_indent () const |
|
int | tolerance () const |
|
bool | is_flush () const |
|
bool | Comparable (const ParagraphModel &other) const |
|
STRING | ToString () const |
|
Definition at line 114 of file ocrpara.h.
◆ ParagraphModel() [1/2]
Definition at line 116 of file ocrpara.h.
130 margin_ += added_margin;
131 first_indent_ -= added_margin;
132 body_indent_ -= added_margin;
tesseract::ParagraphJustification justification() const
◆ ParagraphModel() [2/2]
ParagraphModel::ParagraphModel |
( |
| ) |
|
|
inline |
◆ body_indent()
int ParagraphModel::body_indent |
( |
| ) |
const |
|
inline |
Definition at line 169 of file ocrpara.h.
169 {
return body_indent_; }
◆ Comparable()
Definition at line 80 of file ocrpara.cpp.
81 if (justification_ != other.justification_)
86 int tolerance = (tolerance_ + other.tolerance_) / 4;
88 other.margin_ + other.first_indent_,
tolerance) &&
90 other.margin_ + other.body_indent_,
tolerance);
bool NearlyEqual(T x, T y, T tolerance)
◆ first_indent()
int ParagraphModel::first_indent |
( |
| ) |
const |
|
inline |
Definition at line 168 of file ocrpara.h.
168 {
return first_indent_; }
◆ is_flush()
bool ParagraphModel::is_flush |
( |
| ) |
const |
|
inline |
Definition at line 171 of file ocrpara.h.
174 abs(first_indent_ - body_indent_) <= tolerance_;
◆ justification()
Definition at line 164 of file ocrpara.h.
165 return justification_;
◆ margin()
int ParagraphModel::margin |
( |
| ) |
const |
|
inline |
◆ tolerance()
int ParagraphModel::tolerance |
( |
| ) |
const |
|
inline |
Definition at line 170 of file ocrpara.h.
170 {
return tolerance_; }
◆ ToString()
STRING ParagraphModel::ToString |
( |
| ) |
const |
Definition at line 93 of file ocrpara.cpp.
95 const STRING &alignment = ParagraphJustificationToString(justification_);
96 snprintf(buffer,
sizeof(buffer),
97 "margin: %d, first_indent: %d, body_indent: %d, alignment: %s",
98 margin_, first_indent_, body_indent_, alignment.
string());
const char * string() const
◆ ValidBodyLine()
bool ParagraphModel::ValidBodyLine |
( |
int |
lmargin, |
|
|
int |
lindent, |
|
|
int |
rindent, |
|
|
int |
rmargin |
|
) |
| const |
Definition at line 63 of file ocrpara.cpp.
65 switch (justification_) {
67 return NearlyEqual(lmargin + lindent, margin_ + body_indent_,
70 return NearlyEqual(rmargin + rindent, margin_ + body_indent_,
73 return NearlyEqual(lindent, rindent, tolerance_ * 2);
bool NearlyEqual(T x, T y, T tolerance)
◆ ValidFirstLine()
bool ParagraphModel::ValidFirstLine |
( |
int |
lmargin, |
|
|
int |
lindent, |
|
|
int |
rindent, |
|
|
int |
rmargin |
|
) |
| const |
Definition at line 46 of file ocrpara.cpp.
48 switch (justification_) {
50 return NearlyEqual(lmargin + lindent, margin_ + first_indent_,
53 return NearlyEqual(rmargin + rindent, margin_ + first_indent_,
56 return NearlyEqual(lindent, rindent, tolerance_ * 2);
bool NearlyEqual(T x, T y, T tolerance)
The documentation for this class was generated from the following files:
- /usr/src/tesseract-ocr.master/src/ccstruct/ocrpara.h
- /usr/src/tesseract-ocr.master/src/ccstruct/ocrpara.cpp