#include <paragraphs_internal.h>
Definition at line 100 of file paragraphs_internal.h.
| void tesseract::RowScratchRegisters::AddBodyLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 601 of file paragraphs.cpp.
602 hypotheses_.push_back_new(LineHypothesis(
LT_BODY, model));
603 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_BODY,
NULL));
605 hypotheses_.remove(old_idx);
| void tesseract::RowScratchRegisters::AddStartLine |
( |
const ParagraphModel * |
model | ) |
|
Definition at line 594 of file paragraphs.cpp.
595 hypotheses_.push_back_new(LineHypothesis(
LT_START, model));
596 int old_idx = hypotheses_.get_index(LineHypothesis(
LT_START,
NULL));
598 hypotheses_.remove(old_idx);
| void tesseract::RowScratchRegisters::AppendDebugHeaderFields |
( |
GenericVector< STRING > * |
header | ) |
|
|
static |
Definition at line 493 of file paragraphs.cpp.
496 snprintf(s,
sizeof(s),
"[%3d,%3d;%3d,%3d]",
503 int model_numbers = 0;
504 for (
int h = 0; h < hypotheses_.size(); h++) {
505 if (hypotheses_[h].model ==
NULL)
507 if (model_numbers > 0)
510 model_string += StrOf(1 + theory.IndexOf(hypotheses_[h].model));
511 }
else if (hypotheses_[h].model ==
kCrownLeft) {
512 model_string +=
"CrL";
514 model_string +=
"CrR";
518 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 642 of file paragraphs.cpp.
646 for (
int h = hypotheses_.size() - 1; h >= 0; h--) {
647 if (!models.contains(hypotheses_[h].model)) {
648 hypotheses_.remove(h);
| LineType tesseract::RowScratchRegisters::GetLineType |
( |
| ) |
const |
Definition at line 532 of file paragraphs.cpp.
533 if (hypotheses_.empty())
535 bool has_start =
false;
536 bool has_body =
false;
537 for (
int i = 0; i < hypotheses_.size(); i++) {
538 switch (hypotheses_[i].ty) {
539 case LT_START: has_start =
true;
break;
540 case LT_BODY: has_body =
true;
break;
542 tprintf(
"Encountered bad value in hypothesis list: %c\n",
547 if (has_start && has_body)
DLLSYM void tprintf(const char *format,...)
Definition at line 552 of file paragraphs.cpp.
553 if (hypotheses_.empty())
555 bool has_start =
false;
556 bool has_body =
false;
557 for (
int i = 0; i < hypotheses_.size(); i++) {
558 if (hypotheses_[i].model != model)
560 switch (hypotheses_[i].ty) {
561 case LT_START: has_start =
true;
break;
562 case LT_BODY: has_body =
true;
break;
564 tprintf(
"Encountered bad value in hypothesis list: %c\n",
569 if (has_start && has_body)
DLLSYM void tprintf(const char *format,...)
| void tesseract::RowScratchRegisters::Init |
( |
const RowInfo & |
row | ) |
|
| void tesseract::RowScratchRegisters::NonNullHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 622 of file paragraphs.cpp.
623 for (
int h = 0; h < hypotheses_.size(); h++) {
624 if (hypotheses_[h].model !=
NULL)
625 models->push_back_new(hypotheses_[h].model);
| void tesseract::RowScratchRegisters::SetBodyLine |
( |
| ) |
|
Definition at line 584 of file paragraphs.cpp.
587 tprintf(
"Trying to set a line to be BODY when it's already START.\n");
590 hypotheses_.push_back_new(LineHypothesis(
LT_BODY,
NULL));
DLLSYM void tprintf(const char *format,...)
LineType GetLineType() const
| void tesseract::RowScratchRegisters::SetStartLine |
( |
| ) |
|
Definition at line 574 of file paragraphs.cpp.
577 tprintf(
"Trying to set a line to be START when it's already BODY.\n");
580 hypotheses_.push_back_new(LineHypothesis(
LT_START,
NULL));
DLLSYM void tprintf(const char *format,...)
LineType GetLineType() const
| void tesseract::RowScratchRegisters::SetUnknown |
( |
| ) |
|
|
inline |
| void tesseract::RowScratchRegisters::StartHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 608 of file paragraphs.cpp.
609 for (
int h = 0; h < hypotheses_.size(); h++) {
611 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
| void tesseract::RowScratchRegisters::StrongHypotheses |
( |
SetOfModels * |
models | ) |
const |
Definition at line 615 of file paragraphs.cpp.
616 for (
int h = 0; h < hypotheses_.size(); h++) {
618 models->push_back_new(hypotheses_[h].model);
bool StrongModel(const ParagraphModel *model)
| const ParagraphModel * tesseract::RowScratchRegisters::UniqueBodyHypothesis |
( |
| ) |
const |
Definition at line 635 of file paragraphs.cpp.
636 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_BODY)
638 return hypotheses_[0].model;
| const ParagraphModel * tesseract::RowScratchRegisters::UniqueStartHypothesis |
( |
| ) |
const |
Definition at line 629 of file paragraphs.cpp.
630 if (hypotheses_.size() != 1 || hypotheses_[0].ty !=
LT_START)
632 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: