Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes
tesseract::GeometricClassifierState Struct Reference

List of all members.

## 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

## Detailed Description

Definition at line 810 of file paragraphs.cpp.

## Constructor & Destructor Documentation

tesseract::GeometricClassifierState::GeometricClassifierState | ( | int | dbg_level,
|  | GenericVector< RowScratchRegisters > * | r,
|  | int | r_start,
|  | int | r_end
| ) |  |
| inline

Definition at line 811 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);
ltr = (*r)[r_start].ri_->ltr;
}

## Member Function Documentation

int tesseract::GeometricClassifierState::AlignsideTabIndex | ( | int | row_idx | ) | const
| inline

Definition at line 855 of file paragraphs.cpp.

{
return ClosestCluster(AlignTabs(), (*rows)[row_idx].AlignsideIndent(just));
}

const GenericVector<Cluster>& tesseract::GeometricClassifierState::AlignTabs | ( |  | ) | const
| inline

Definition at line 833 of file paragraphs.cpp.

{
if (just == tesseract::JUSTIFICATION_RIGHT) return right_tabs;
return left_tabs;
}

void tesseract::GeometricClassifierState::AssumeLeftJustification | ( |  | ) |
| inline

Definition at line 822 of file paragraphs.cpp.

{
just = tesseract::JUSTIFICATION_LEFT;
margin = (*rows)[row_start].lmargin_;
}

void tesseract::GeometricClassifierState::AssumeRightJustification | ( |  | ) |
| inline

Definition at line 827 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 868 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 861 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 850 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 874 of file paragraphs.cpp.

{
return ParagraphModel(just, margin, first_indent, body_indent, tolerance);
}

const GenericVector<Cluster>& tesseract::GeometricClassifierState::OffsideTabs | ( |  | ) | const
| inline

Definition at line 843 of file paragraphs.cpp.

{
if (just == tesseract::JUSTIFICATION_RIGHT) return left_tabs;
return right_tabs;
}

void tesseract::GeometricClassifierState::PrintRows | ( |  | ) | const
| inline

Definition at line 866 of file paragraphs.cpp.

{ PrintRowRange(*rows, row_start, row_end); }

## Member Data Documentation

int tesseract::GeometricClassifierState::body_indent

Definition at line 903 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::debug_level

Definition at line 879 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::eop_threshold

Definition at line 906 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::first_indent

Definition at line 902 of file paragraphs.cpp.

tesseract::ParagraphJustification tesseract::GeometricClassifierState::just

Definition at line 900 of file paragraphs.cpp.

GenericVector<Cluster> tesseract::GeometricClassifierState::left_tabs

Definition at line 896 of file paragraphs.cpp.

bool tesseract::GeometricClassifierState::ltr

Definition at line 892 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::margin

Definition at line 901 of file paragraphs.cpp.

GenericVector<Cluster> tesseract::GeometricClassifierState::right_tabs

Definition at line 897 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::row_end

Definition at line 885 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::row_start

Definition at line 884 of file paragraphs.cpp.

GenericVector<RowScratchRegisters>* tesseract::GeometricClassifierState::rows

Definition at line 883 of file paragraphs.cpp.

int tesseract::GeometricClassifierState::tolerance

Definition at line 888 of file paragraphs.cpp.

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

- /mnt/data/src/tesseract-ocr/ccmain/paragraphs.cpp