#include <paragraphs_internal.h>
Definition at line 100 of file paragraphs_internal.h.
◆ AddBodyLine()
void tesseract::RowScratchRegisters::AddBodyLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 589 of file paragraphs.cpp.
590 hypotheses_.push_back_new(LineHypothesis(
LT_BODY, model));
591 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_BODY, NULL));
593 hypotheses_.remove(old_idx);
◆ AddStartLine()
void tesseract::RowScratchRegisters::AddStartLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 582 of file paragraphs.cpp.
583 hypotheses_.push_back_new(LineHypothesis(
LT_START, model));
584 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_START, NULL));
586 hypotheses_.remove(old_idx);
◆ AlignsideIndent()
◆ AppendDebugHeaderFields()
void tesseract::RowScratchRegisters::AppendDebugHeaderFields |
( |
GenericVector< STRING > * |
header | ) |
|
|
static |
◆ AppendDebugInfo()
Definition at line 481 of file paragraphs.cpp.
484 snprintf(s,
sizeof(s),
"[%3d,%3d;%3d,%3d]",
491 int model_numbers = 0;
492 for (
int h = 0; h < hypotheses_.size(); h++) {
493 if (hypotheses_[h].model == NULL)
495 if (model_numbers > 0)
498 model_string += StrOf(1 + theory.IndexOf(hypotheses_[h].model));
499 }
else if (hypotheses_[h].model ==
kCrownLeft) {
500 model_string +=
"CrL";
502 model_string +=
"CrR";
506 if (model_numbers == 0)
LineType GetLineType() const
const ParagraphModel * kCrownLeft
bool StrongModel(const ParagraphModel *model)
const ParagraphModel * kCrownRight
◆ DiscardNonMatchingHypotheses()
void tesseract::RowScratchRegisters::DiscardNonMatchingHypotheses |
( |
const SetOfModels & |
models | ) |
|
Definition at line 630 of file paragraphs.cpp.
634 for (
int h = hypotheses_.size() - 1; h >= 0; h--) {
635 if (!models.contains(hypotheses_[h].model)) {
636 hypotheses_.remove(h);
◆ GetLineType() [1/2]
LineType tesseract::RowScratchRegisters::GetLineType |
( |
| ) |
const |
Definition at line 520 of file paragraphs.cpp.
521 if (hypotheses_.empty())
523 bool has_start =
false;
524 bool has_body =
false;
525 for (
int i = 0; i < hypotheses_.size(); i++) {
526 switch (hypotheses_[i].ty) {
527 case LT_START: has_start =
true;
break;
528 case LT_BODY: has_body =
true;
break;
530 tprintf(
"Encountered bad value in hypothesis list: %c\n",
535 if (has_start && has_body)
◆ GetLineType() [2/2]
Definition at line 540 of file paragraphs.cpp.
541 if (hypotheses_.empty())
543 bool has_start =
false;
544 bool has_body =
false;
545 for (
int i = 0; i < hypotheses_.size(); i++) {
546 if (hypotheses_[i].model != model)
548 switch (hypotheses_[i].ty) {
549 case LT_START: has_start =
true;
break;
550 case LT_BODY: has_body =
true;
break;
552 tprintf(
"Encountered bad value in hypothesis list: %c\n",
557 if (has_start && has_body)
◆ Init()
void tesseract::RowScratchRegisters::Init |
( |
const RowInfo & |
row | ) |
|
◆ NonNullHypotheses()
void tesseract::RowScratchRegisters::NonNullHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 610 of file paragraphs.cpp.
611 for (
int h = 0; h < hypotheses_.size(); h++) {
612 if (hypotheses_[h].model != NULL)
613 models->push_back_new(hypotheses_[h].model);
◆ OffsideIndent()
◆ SetBodyLine()
void tesseract::RowScratchRegisters::SetBodyLine |
( |
| ) |
|
Definition at line 572 of file paragraphs.cpp.
575 tprintf(
"Trying to set a line to be BODY when it's already START.\n");
578 hypotheses_.push_back_new(LineHypothesis(
LT_BODY, NULL));
LineType GetLineType() const
◆ SetStartLine()
void tesseract::RowScratchRegisters::SetStartLine |
( |
| ) |
|
Definition at line 562 of file paragraphs.cpp.
565 tprintf(
"Trying to set a line to be START when it's already BODY.\n");
568 hypotheses_.push_back_new(LineHypothesis(
LT_START, NULL));
LineType GetLineType() const
◆ SetUnknown()
void tesseract::RowScratchRegisters::SetUnknown |
( |
| ) |
|
|
inline |
◆ StartHypotheses()
void tesseract::RowScratchRegisters::StartHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 596 of file paragraphs.cpp.
597 for (
int h = 0; h < hypotheses_.size(); h++) {
599 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
◆ StrongHypotheses()
void tesseract::RowScratchRegisters::StrongHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 603 of file paragraphs.cpp.
604 for (
int h = 0; h < hypotheses_.size(); h++) {
606 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
◆ UniqueBodyHypothesis()
const ParagraphModel * tesseract::RowScratchRegisters::UniqueBodyHypothesis |
( |
| ) |
const |
Definition at line 623 of file paragraphs.cpp.
624 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_BODY)
626 return hypotheses_[0].model;
◆ UniqueStartHypothesis()
const ParagraphModel * tesseract::RowScratchRegisters::UniqueStartHypothesis |
( |
| ) |
const |
Definition at line 617 of file paragraphs.cpp.
618 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_START)
620 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: