tesseract
3.03
|
Public Member Functions | |
GeometricClassifierState (int dbg_level, GenericVector< RowScratchRegisters > *r, int r_start, int r_end) | |
void | AssumeLeftJustification () |
void | AssumeRightJustification () |
const GenericVector< Cluster > & | AlignTabs () const |
const GenericVector< Cluster > & | OffsideTabs () const |
bool | IsFullRow (int i) const |
int | AlignsideTabIndex (int row_idx) const |
bool | FirstWordWouldHaveFit (int row_a, int row_b) |
void | PrintRows () const |
void | Fail (int min_debug_level, const char *why) const |
ParagraphModel | Model () const |
Public Attributes | |
int | debug_level |
GenericVector < RowScratchRegisters > * | rows |
int | row_start |
int | row_end |
int | tolerance |
bool | ltr |
GenericVector< Cluster > | left_tabs |
GenericVector< Cluster > | right_tabs |
tesseract::ParagraphJustification | just |
int | margin |
int | first_indent |
int | body_indent |
int | eop_threshold |
Definition at line 854 of file paragraphs.cpp.
tesseract::GeometricClassifierState::GeometricClassifierState | ( | int | dbg_level, |
GenericVector< RowScratchRegisters > * | r, | ||
int | r_start, | ||
int | r_end | ||
) | [inline] |
Definition at line 855 of file paragraphs.cpp.
: debug_level(dbg_level), rows(r), row_start(r_start), row_end(r_end), margin(0) { tolerance = InterwordSpace(*r, r_start, r_end); CalculateTabStops(r, r_start, r_end, tolerance, &left_tabs, &right_tabs); if (debug_level >= 3) { tprintf("Geometry: TabStop cluster tolerance = %d; " "%d left tabs; %d right tabs\n", tolerance, left_tabs.size(), right_tabs.size()); } ltr = (*r)[r_start].ri_->ltr; }
int tesseract::GeometricClassifierState::AlignsideTabIndex | ( | int | row_idx | ) | const [inline] |
Definition at line 904 of file paragraphs.cpp.
{ return ClosestCluster(AlignTabs(), (*rows)[row_idx].AlignsideIndent(just)); }
const GenericVector<Cluster>& tesseract::GeometricClassifierState::AlignTabs | ( | ) | const [inline] |
Definition at line 882 of file paragraphs.cpp.
{ if (just == tesseract::JUSTIFICATION_RIGHT) return right_tabs; return left_tabs; }
void tesseract::GeometricClassifierState::AssumeLeftJustification | ( | ) | [inline] |
Definition at line 871 of file paragraphs.cpp.
{ just = tesseract::JUSTIFICATION_LEFT; margin = (*rows)[row_start].lmargin_; }
void tesseract::GeometricClassifierState::AssumeRightJustification | ( | ) | [inline] |
Definition at line 876 of file paragraphs.cpp.
{ just = tesseract::JUSTIFICATION_RIGHT; margin = (*rows)[row_start].rmargin_; }
void tesseract::GeometricClassifierState::Fail | ( | int | min_debug_level, |
const char * | why | ||
) | const [inline] |
Definition at line 917 of file paragraphs.cpp.
{ if (debug_level < min_debug_level) return; tprintf("# %s\n", why); PrintRows(); }
bool tesseract::GeometricClassifierState::FirstWordWouldHaveFit | ( | int | row_a, |
int | row_b | ||
) | [inline] |
Definition at line 910 of file paragraphs.cpp.
{ return ::tesseract::FirstWordWouldHaveFit( (*rows)[row_a], (*rows)[row_b], just); }
bool tesseract::GeometricClassifierState::IsFullRow | ( | int | i | ) | const [inline] |
Definition at line 899 of file paragraphs.cpp.
{ return ClosestCluster(left_tabs, (*rows)[i].lindent_) == 0 && ClosestCluster(right_tabs, (*rows)[i].rindent_) == 0; }
ParagraphModel tesseract::GeometricClassifierState::Model | ( | ) | const [inline] |
Definition at line 923 of file paragraphs.cpp.
{ return ParagraphModel(just, margin, first_indent, body_indent, tolerance); }
const GenericVector<Cluster>& tesseract::GeometricClassifierState::OffsideTabs | ( | ) | const [inline] |
Definition at line 892 of file paragraphs.cpp.
{ if (just == tesseract::JUSTIFICATION_RIGHT) return left_tabs; return right_tabs; }
void tesseract::GeometricClassifierState::PrintRows | ( | ) | const [inline] |
Definition at line 915 of file paragraphs.cpp.
Definition at line 952 of file paragraphs.cpp.
Definition at line 928 of file paragraphs.cpp.
Definition at line 955 of file paragraphs.cpp.
Definition at line 951 of file paragraphs.cpp.
Definition at line 949 of file paragraphs.cpp.
Definition at line 945 of file paragraphs.cpp.
Definition at line 941 of file paragraphs.cpp.
Definition at line 950 of file paragraphs.cpp.
Definition at line 946 of file paragraphs.cpp.
Definition at line 934 of file paragraphs.cpp.
Definition at line 933 of file paragraphs.cpp.
Definition at line 932 of file paragraphs.cpp.
Definition at line 937 of file paragraphs.cpp.