#include <paragraphs_internal.h>
Definition at line 103 of file paragraphs_internal.h.
◆ AddBodyLine()
void tesseract::RowScratchRegisters::AddBodyLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 603 of file paragraphs.cpp.
604 hypotheses_.push_back_new(LineHypothesis(
LT_BODY, model));
605 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_BODY,
nullptr));
607 hypotheses_.remove(old_idx);
◆ AddStartLine()
void tesseract::RowScratchRegisters::AddStartLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 596 of file paragraphs.cpp.
597 hypotheses_.push_back_new(LineHypothesis(
LT_START, model));
598 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_START,
nullptr));
600 hypotheses_.remove(old_idx);
◆ AlignsideIndent()
◆ AppendDebugHeaderFields()
void tesseract::RowScratchRegisters::AppendDebugHeaderFields |
( |
GenericVector< STRING > * |
header | ) |
|
|
static |
◆ AppendDebugInfo()
Definition at line 495 of file paragraphs.cpp.
498 snprintf(s,
sizeof(s),
"[%3d,%3d;%3d,%3d]",
505 int model_numbers = 0;
506 for (
int h = 0; h < hypotheses_.size(); h++) {
507 if (hypotheses_[h].model ==
nullptr)
509 if (model_numbers > 0)
512 model_string += StrOf(1 + theory.IndexOf(hypotheses_[h].model));
513 }
else if (hypotheses_[h].model ==
kCrownLeft) {
514 model_string +=
"CrL";
516 model_string +=
"CrR";
520 if (model_numbers == 0)
const ParagraphModel * kCrownRight
bool StrongModel(const ParagraphModel *model)
LineType GetLineType() const
const ParagraphModel * kCrownLeft
◆ DiscardNonMatchingHypotheses()
void tesseract::RowScratchRegisters::DiscardNonMatchingHypotheses |
( |
const SetOfModels & |
models | ) |
|
Definition at line 644 of file paragraphs.cpp.
648 for (
int h = hypotheses_.size() - 1; h >= 0; h--) {
649 if (!models.contains(hypotheses_[h].model)) {
650 hypotheses_.remove(h);
◆ GetLineType() [1/2]
LineType tesseract::RowScratchRegisters::GetLineType |
( |
| ) |
const |
Definition at line 534 of file paragraphs.cpp.
535 if (hypotheses_.empty())
537 bool has_start =
false;
538 bool has_body =
false;
539 for (
int i = 0; i < hypotheses_.size(); i++) {
540 switch (hypotheses_[i].ty) {
541 case LT_START: has_start =
true;
break;
542 case LT_BODY: has_body =
true;
break;
544 tprintf(
"Encountered bad value in hypothesis list: %c\n",
549 if (has_start && has_body)
DLLSYM void tprintf(const char *format,...)
◆ GetLineType() [2/2]
Definition at line 554 of file paragraphs.cpp.
555 if (hypotheses_.empty())
557 bool has_start =
false;
558 bool has_body =
false;
559 for (
int i = 0; i < hypotheses_.size(); i++) {
560 if (hypotheses_[i].model != model)
562 switch (hypotheses_[i].ty) {
563 case LT_START: has_start =
true;
break;
564 case LT_BODY: has_body =
true;
break;
566 tprintf(
"Encountered bad value in hypothesis list: %c\n",
571 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 624 of file paragraphs.cpp.
625 for (
int h = 0; h < hypotheses_.size(); h++) {
626 if (hypotheses_[h].model !=
nullptr)
627 models->push_back_new(hypotheses_[h].model);
◆ OffsideIndent()
◆ SetBodyLine()
void tesseract::RowScratchRegisters::SetBodyLine |
( |
| ) |
|
Definition at line 586 of file paragraphs.cpp.
589 tprintf(
"Trying to set a line to be BODY when it's already START.\n");
592 hypotheses_.push_back_new(LineHypothesis(
LT_BODY,
nullptr));
DLLSYM void tprintf(const char *format,...)
LineType GetLineType() const
◆ SetStartLine()
void tesseract::RowScratchRegisters::SetStartLine |
( |
| ) |
|
Definition at line 576 of file paragraphs.cpp.
579 tprintf(
"Trying to set a line to be START when it's already BODY.\n");
582 hypotheses_.push_back_new(LineHypothesis(
LT_START,
nullptr));
DLLSYM void tprintf(const char *format,...)
LineType GetLineType() const
◆ SetUnknown()
void tesseract::RowScratchRegisters::SetUnknown |
( |
| ) |
|
|
inline |
◆ StartHypotheses()
void tesseract::RowScratchRegisters::StartHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 610 of file paragraphs.cpp.
611 for (
int h = 0; h < hypotheses_.size(); h++) {
613 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
◆ StrongHypotheses()
void tesseract::RowScratchRegisters::StrongHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 617 of file paragraphs.cpp.
618 for (
int h = 0; h < hypotheses_.size(); h++) {
620 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
◆ UniqueBodyHypothesis()
const ParagraphModel * tesseract::RowScratchRegisters::UniqueBodyHypothesis |
( |
| ) |
const |
Definition at line 637 of file paragraphs.cpp.
638 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_BODY)
640 return hypotheses_[0].model;
◆ UniqueStartHypothesis()
const ParagraphModel * tesseract::RowScratchRegisters::UniqueStartHypothesis |
( |
| ) |
const |
Definition at line 631 of file paragraphs.cpp.
632 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_START)
634 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: