tesseract  5.0.0-alpha-619-ge9db
tesseract::GeometricClassifierState Struct Reference

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 = 0
 
GenericVector< RowScratchRegisters > * rows
 
int row_start = 0
 
int row_end = 0
 
int tolerance = 0
 
bool ltr = false
 
GenericVector< Clusterleft_tabs
 
GenericVector< Clusterright_tabs
 
tesseract::ParagraphJustification just = JUSTIFICATION_UNKNOWN
 
int margin = 0
 
int first_indent = 0
 
int body_indent = 0
 
int eop_threshold = 0
 

Detailed Description

Definition at line 881 of file paragraphs.cpp.

Constructor & Destructor Documentation

◆ GeometricClassifierState()

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

Definition at line 882 of file paragraphs.cpp.

882  {
884  margin = (*rows)[row_start].lmargin_;
885  }
886 
887  void AssumeRightJustification() {
889  margin = (*rows)[row_start].rmargin_;
890  }
891 
892  // Align tabs are the tab stops the text is aligned to.
893  const GenericVector<Cluster> &AlignTabs() const {
895  return left_tabs;

Member Function Documentation

◆ AlignsideTabIndex()

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

Definition at line 930 of file paragraphs.cpp.

934  {

◆ AlignTabs()

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

Definition at line 908 of file paragraphs.cpp.

910  {
911  return ClosestCluster(left_tabs, (*rows)[i].lindent_) == 0 &&

◆ AssumeLeftJustification()

void tesseract::GeometricClassifierState::AssumeLeftJustification ( )
inline

Definition at line 897 of file paragraphs.cpp.

903  {

◆ AssumeRightJustification()

void tesseract::GeometricClassifierState::AssumeRightJustification ( )
inline

Definition at line 902 of file paragraphs.cpp.

903  {
905  return right_tabs;

◆ Fail()

void tesseract::GeometricClassifierState::Fail ( int  min_debug_level,
const char *  why 
) const
inline

Definition at line 943 of file paragraphs.cpp.

◆ FirstWordWouldHaveFit()

bool tesseract::GeometricClassifierState::FirstWordWouldHaveFit ( int  row_a,
int  row_b 
)
inline

Definition at line 936 of file paragraphs.cpp.

◆ IsFullRow()

bool tesseract::GeometricClassifierState::IsFullRow ( int  i) const
inline

Definition at line 925 of file paragraphs.cpp.

926  { PrintRowRange(*rows, row_start, row_end); }
927 
928  void Fail(int min_debug_level, const char *why) const {

◆ Model()

ParagraphModel tesseract::GeometricClassifierState::Model ( ) const
inline

Definition at line 949 of file paragraphs.cpp.

◆ OffsideTabs()

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

Definition at line 918 of file paragraphs.cpp.

921  {

◆ PrintRows()

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

Definition at line 941 of file paragraphs.cpp.

Member Data Documentation

◆ body_indent

int tesseract::GeometricClassifierState::body_indent = 0

Definition at line 978 of file paragraphs.cpp.

◆ debug_level

int tesseract::GeometricClassifierState::debug_level = 0

Definition at line 954 of file paragraphs.cpp.

◆ eop_threshold

int tesseract::GeometricClassifierState::eop_threshold = 0

Definition at line 981 of file paragraphs.cpp.

◆ first_indent

int tesseract::GeometricClassifierState::first_indent = 0

Definition at line 977 of file paragraphs.cpp.

◆ just

tesseract::ParagraphJustification tesseract::GeometricClassifierState::just = JUSTIFICATION_UNKNOWN

Definition at line 975 of file paragraphs.cpp.

◆ left_tabs

GenericVector<Cluster> tesseract::GeometricClassifierState::left_tabs

Definition at line 971 of file paragraphs.cpp.

◆ ltr

bool tesseract::GeometricClassifierState::ltr = false

Definition at line 967 of file paragraphs.cpp.

◆ margin

int tesseract::GeometricClassifierState::margin = 0

Definition at line 976 of file paragraphs.cpp.

◆ right_tabs

GenericVector<Cluster> tesseract::GeometricClassifierState::right_tabs

Definition at line 972 of file paragraphs.cpp.

◆ row_end

int tesseract::GeometricClassifierState::row_end = 0

Definition at line 960 of file paragraphs.cpp.

◆ row_start

int tesseract::GeometricClassifierState::row_start = 0

Definition at line 959 of file paragraphs.cpp.

◆ rows

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

Definition at line 958 of file paragraphs.cpp.

◆ tolerance

int tesseract::GeometricClassifierState::tolerance = 0

Definition at line 963 of file paragraphs.cpp.


The documentation for this struct was generated from the following file:
tesseract::JUSTIFICATION_RIGHT
Definition: publictypes.h:252
tesseract::GeometricClassifierState::row_end
int row_end
Definition: paragraphs.cpp:960
tesseract::GeometricClassifierState::rows
GenericVector< RowScratchRegisters > * rows
Definition: paragraphs.cpp:958
tesseract::GeometricClassifierState::margin
int margin
Definition: paragraphs.cpp:976
tesseract::JUSTIFICATION_LEFT
Definition: publictypes.h:250
tesseract::GeometricClassifierState::AssumeRightJustification
void AssumeRightJustification()
Definition: paragraphs.cpp:902
tesseract::GeometricClassifierState::just
tesseract::ParagraphJustification just
Definition: paragraphs.cpp:975
tesseract::GeometricClassifierState::row_start
int row_start
Definition: paragraphs.cpp:959
tesseract::GeometricClassifierState::Fail
void Fail(int min_debug_level, const char *why) const
Definition: paragraphs.cpp:943
GenericVector
Definition: baseapi.h:40
tesseract::GeometricClassifierState::left_tabs
GenericVector< Cluster > left_tabs
Definition: paragraphs.cpp:971
tesseract::GeometricClassifierState::AlignTabs
const GenericVector< Cluster > & AlignTabs() const
Definition: paragraphs.cpp:908
tesseract::GeometricClassifierState::right_tabs
GenericVector< Cluster > right_tabs
Definition: paragraphs.cpp:972