#include <paragraphs_internal.h>
Definition at line 103 of file paragraphs_internal.h.
◆ AddBodyLine()
void tesseract::RowScratchRegisters::AddBodyLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 604 of file paragraphs.cpp.
605 hypotheses_.push_back_new(LineHypothesis(
LT_BODY, model));
606 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_BODY,
nullptr));
608 hypotheses_.remove(old_idx);
◆ AddStartLine()
void tesseract::RowScratchRegisters::AddStartLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 597 of file paragraphs.cpp.
598 hypotheses_.push_back_new(LineHypothesis(
LT_START, model));
599 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_START,
nullptr));
601 hypotheses_.remove(old_idx);
◆ AlignsideIndent()
◆ AppendDebugHeaderFields()
void tesseract::RowScratchRegisters::AppendDebugHeaderFields |
( |
GenericVector< STRING > * |
header | ) |
|
|
static |
◆ AppendDebugInfo()
Definition at line 496 of file paragraphs.cpp.
499 snprintf(s,
sizeof(s),
"[%3d,%3d;%3d,%3d]",
506 int model_numbers = 0;
507 for (
int h = 0; h < hypotheses_.size(); h++) {
508 if (hypotheses_[h].model ==
nullptr)
510 if (model_numbers > 0)
513 model_string += StrOf(1 + theory.IndexOf(hypotheses_[h].model));
514 }
else if (hypotheses_[h].model ==
kCrownLeft) {
515 model_string +=
"CrL";
517 model_string +=
"CrR";
521 if (model_numbers == 0)
const ParagraphModel * kCrownRight
LineType GetLineType() const
const ParagraphModel * kCrownLeft
bool StrongModel(const ParagraphModel *model)
◆ DiscardNonMatchingHypotheses()
void tesseract::RowScratchRegisters::DiscardNonMatchingHypotheses |
( |
const SetOfModels & |
models | ) |
|
Definition at line 645 of file paragraphs.cpp.
649 for (
int h = hypotheses_.size() - 1; h >= 0; h--) {
650 if (!models.contains(hypotheses_[h].model)) {
651 hypotheses_.remove(h);
◆ GetLineType() [1/2]
LineType tesseract::RowScratchRegisters::GetLineType |
( |
| ) |
const |
Definition at line 535 of file paragraphs.cpp.
536 if (hypotheses_.empty())
538 bool has_start =
false;
539 bool has_body =
false;
540 for (
int i = 0; i < hypotheses_.size(); i++) {
541 switch (hypotheses_[i].ty) {
542 case LT_START: has_start =
true;
break;
543 case LT_BODY: has_body =
true;
break;
545 tprintf(
"Encountered bad value in hypothesis list: %c\n",
550 if (has_start && has_body)
DLLSYM void tprintf(const char *format,...)
◆ GetLineType() [2/2]
Definition at line 555 of file paragraphs.cpp.
556 if (hypotheses_.empty())
558 bool has_start =
false;
559 bool has_body =
false;
560 for (
int i = 0; i < hypotheses_.size(); i++) {
561 if (hypotheses_[i].model != model)
563 switch (hypotheses_[i].ty) {
564 case LT_START: has_start =
true;
break;
565 case LT_BODY: has_body =
true;
break;
567 tprintf(
"Encountered bad value in hypothesis list: %c\n",
572 if (has_start && has_body)
DLLSYM void tprintf(const char *format,...)
◆ Init()
void tesseract::RowScratchRegisters::Init |
( |
const RowInfo & |
row | ) |
|
◆ NonNullHypotheses()
void tesseract::RowScratchRegisters::NonNullHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 625 of file paragraphs.cpp.
626 for (
int h = 0; h < hypotheses_.size(); h++) {
627 if (hypotheses_[h].model !=
nullptr)
628 models->push_back_new(hypotheses_[h].model);
◆ OffsideIndent()
◆ SetBodyLine()
void tesseract::RowScratchRegisters::SetBodyLine |
( |
| ) |
|
Definition at line 587 of file paragraphs.cpp.
590 tprintf(
"Trying to set a line to be BODY when it's already START.\n");
593 hypotheses_.push_back_new(LineHypothesis(
LT_BODY,
nullptr));
LineType GetLineType() const
DLLSYM void tprintf(const char *format,...)
◆ SetStartLine()
void tesseract::RowScratchRegisters::SetStartLine |
( |
| ) |
|
Definition at line 577 of file paragraphs.cpp.
580 tprintf(
"Trying to set a line to be START when it's already BODY.\n");
583 hypotheses_.push_back_new(LineHypothesis(
LT_START,
nullptr));
LineType GetLineType() const
DLLSYM void tprintf(const char *format,...)
◆ SetUnknown()
void tesseract::RowScratchRegisters::SetUnknown |
( |
| ) |
|
|
inline |
◆ StartHypotheses()
void tesseract::RowScratchRegisters::StartHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 611 of file paragraphs.cpp.
612 for (
int h = 0; h < hypotheses_.size(); h++) {
614 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
◆ StrongHypotheses()
void tesseract::RowScratchRegisters::StrongHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 618 of file paragraphs.cpp.
619 for (
int h = 0; h < hypotheses_.size(); h++) {
621 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
◆ UniqueBodyHypothesis()
const ParagraphModel * tesseract::RowScratchRegisters::UniqueBodyHypothesis |
( |
| ) |
const |
Definition at line 638 of file paragraphs.cpp.
639 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_BODY)
641 return hypotheses_[0].model;
◆ UniqueStartHypothesis()
const ParagraphModel * tesseract::RowScratchRegisters::UniqueStartHypothesis |
( |
| ) |
const |
Definition at line 632 of file paragraphs.cpp.
633 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_START)
635 return hypotheses_[0].model;
◆ lindent_
int tesseract::RowScratchRegisters::lindent_ |
◆ lmargin_
int tesseract::RowScratchRegisters::lmargin_ |
◆ ri_
const RowInfo* tesseract::RowScratchRegisters::ri_ |
◆ rindent_
int tesseract::RowScratchRegisters::rindent_ |
◆ rmargin_
int tesseract::RowScratchRegisters::rmargin_ |
The documentation for this class was generated from the following files: