#include <paragraphs_internal.h>
Definition at line 100 of file paragraphs_internal.h.
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);
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);
void tesseract::RowScratchRegisters::AppendDebugHeaderFields |
( |
GenericVector< STRING > * |
header | ) |
|
|
static |
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)
const ParagraphModel * kCrownRight
bool StrongModel(const ParagraphModel *model)
const ParagraphModel * kCrownLeft
LineType GetLineType() const
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);
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)
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)
void tesseract::RowScratchRegisters::Init |
( |
const RowInfo & |
row | ) |
|
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);
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
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
void tesseract::RowScratchRegisters::SetUnknown |
( |
| ) |
|
|
inline |
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)
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)
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;
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;
int tesseract::RowScratchRegisters::lindent_ |
int tesseract::RowScratchRegisters::lmargin_ |
const RowInfo* tesseract::RowScratchRegisters::ri_ |
int tesseract::RowScratchRegisters::rindent_ |
int tesseract::RowScratchRegisters::rmargin_ |
The documentation for this class was generated from the following files: