Tesseract  3.02
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< Clusterleft_tabs
GenericVector< Clusterright_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.

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.

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.

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

Definition at line 843 of file paragraphs.cpp.

void tesseract::GeometricClassifierState::PrintRows ( ) const [inline]

Definition at line 866 of file paragraphs.cpp.

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

Member Data Documentation


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