19 #ifndef TESSERACT_CCMAIN_PARAGRAPHS_INTERNAL_H_ 20 #define TESSERACT_CCMAIN_PARAGRAPHS_INTERNAL_H_ 22 #include "paragraphs.h" 23 #include "publictypes.h" 43 bool *is_list,
bool *starts_idea,
bool *ends_idea);
48 bool *is_list,
bool *starts_idea,
bool *ends_idea);
72 return model !=
nullptr && model != kCrownLeft && model !=
kCrownRight;
138 void DiscardNonMatchingHypotheses(
const SetOfModels &models);
153 default:
return lindent_ > rindent_ ? lindent_ : rindent_;
162 default:
return lindent_ > rindent_ ? lindent_ : rindent_;
214 int start,
int end)
const;
240 int row_start,
int row_end,
254 void CalculateOpenModels(
int row_start,
int row_end);
257 return open_models_[row - row_start_ + 1];
285 int row_start,
int row_end);
307 PARA_LIST *paragraphs);
311 #endif // TESSERACT_CCMAIN_PARAGRAPHS_INTERNAL_H_ bool RowsFitModel(const GenericVector< RowScratchRegisters > *rows, int start, int end, const ParagraphModel *model)
Definition: paragraphs.cpp:1813
int row_end_
Definition: paragraphs_internal.h:263
Definition: resultiterator.h:33
Definition: paragraphs_internal.h:192
GenericVectorEqEq< ParagraphModel * > models_we_added_
Definition: paragraphs_internal.h:220
void SetUnknown()
Definition: paragraphs_internal.h:126
GenericVector< ParagraphModel * > & models()
Definition: paragraphs_internal.h:198
const ParagraphModel * kCrownRight
Definition: paragraphs.cpp:57
Definition: paragraphs_internal.h:103
Definition: ocrpara.h:114
void LeftWordAttributes(const UNICHARSET *unicharset, const WERD_CHOICE *werd, const STRING &utf8, bool *is_list, bool *starts_idea, bool *ends_idea)
Definition: paragraphs.cpp:409
int InterwordSpace(const GenericVector< RowScratchRegisters > &rows, int row_start, int row_end)
Definition: paragraphs.cpp:1610
Definition: paragraphs.h:41
Definition: unicharset.h:146
int OffsideIndent(tesseract::ParagraphJustification just) const
Definition: paragraphs_internal.h:149
bool CrownCompatible(const GenericVector< RowScratchRegisters > *rows, int a, int b, const ParagraphModel *model)
Definition: paragraphs.cpp:1301
bool ValidBodyLine(const GenericVector< RowScratchRegisters > *rows, int row, const ParagraphModel *model)
Definition: paragraphs.cpp:1290
int rmargin_
Definition: paragraphs_internal.h:183
GenericVector< RowScratchRegisters > * rows_
Definition: paragraphs_internal.h:261
int UnicodeFor(const UNICHARSET *u, const WERD_CHOICE *werd, int pos)
Definition: paragraphs.cpp:289
Definition: baseapi.cpp:94
int lmargin_
Definition: paragraphs_internal.h:180
Definition: paragraphs_internal.h:51
LineHypothesis(LineType line_type, const ParagraphModel *m)
Definition: paragraphs_internal.h:77
LineType ty
Definition: paragraphs_internal.h:93
GenericVector< SetOfModels > open_models_
Definition: paragraphs_internal.h:273
const ParagraphModel * model
Definition: paragraphs_internal.h:94
int rindent_
Definition: paragraphs_internal.h:182
bool ValidFirstLine(const GenericVector< RowScratchRegisters > *rows, int row, const ParagraphModel *model)
Definition: paragraphs.cpp:1279
bool operator==(const LineHypothesis &other) const
Definition: paragraphs_internal.h:89
Definition: paragraphs_internal.h:54
Definition: paragraphs_internal.h:53
bool AsciiLikelyListItem(const STRING &word)
Definition: paragraphs.cpp:282
ParagraphJustification
Definition: publictypes.h:251
bool StrongModel(const ParagraphModel *model)
Definition: paragraphs_internal.h:71
const ParagraphModel * kCrownLeft
Definition: paragraphs.cpp:55
void RightWordAttributes(const UNICHARSET *unicharset, const WERD_CHOICE *werd, const STRING &utf8, bool *is_list, bool *starts_idea, bool *ends_idea)
Definition: paragraphs.cpp:456
bool FirstWordWouldHaveFit(const RowScratchRegisters &before, const RowScratchRegisters &after, tesseract::ParagraphJustification justification)
Definition: paragraphs.cpp:1633
void CanonicalizeDetectionResults(GenericVector< PARA *> *row_owners, PARA_LIST *paragraphs)
Definition: paragraphs.cpp:2239
SetOfModels & OpenModels(int row)
Definition: paragraphs_internal.h:256
Definition: publictypes.h:255
GenericVector< ParagraphModel * > * models_
Definition: paragraphs_internal.h:219
const GenericVector< ParagraphModel * > & models() const
Definition: paragraphs_internal.h:199
LineHypothesis & operator=(const LineHypothesis &other)
Definition: paragraphs_internal.h:83
Definition: paragraphs_internal.h:237
Definition: paragraphs_internal.h:52
ParagraphTheory * theory_
Definition: paragraphs_internal.h:260
int row_start_
Definition: paragraphs_internal.h:262
static void DiscardUnusedModels(const GenericVector< RowScratchRegisters > &rows, ParagraphTheory *theory)
Definition: paragraphs.cpp:1468
LineHypothesis(const LineHypothesis &other)
Definition: paragraphs_internal.h:79
Definition: publictypes.h:253
LineType
Definition: paragraphs_internal.h:50
LineHypothesis()
Definition: paragraphs_internal.h:76
void RecomputeMarginsAndClearHypotheses(GenericVector< RowScratchRegisters > *rows, int start, int end, int percentile)
Definition: paragraphs.cpp:1570
int AlignsideIndent(tesseract::ParagraphJustification just) const
Definition: paragraphs_internal.h:158
Definition: paragraphs_internal.h:75
GenericVectorEqEq< LineHypothesis > hypotheses_
Definition: paragraphs_internal.h:187
int lindent_
Definition: paragraphs_internal.h:181
const RowInfo * ri_
Definition: paragraphs_internal.h:173
ParagraphTheory(GenericVector< ParagraphModel *> *models)
Definition: paragraphs_internal.h:196