MCPcopy Create free account
hub / github.com/creatale/node-dv / GetLineType

Method GetLineType

deps/tesseract/ccmain/paragraphs.cpp:520–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520LineType RowScratchRegisters::GetLineType() const {
521 if (hypotheses_.empty())
522 return LT_UNKNOWN;
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;
529 default:
530 tprintf("Encountered bad value in hypothesis list: %c\n",
531 hypotheses_[i].ty);
532 break;
533 }
534 }
535 if (has_start && has_body)
536 return LT_MULTIPLE;
537 return has_start ? LT_START : LT_BODY;
538}
539
540LineType RowScratchRegisters::GetLineType(const ParagraphModel *model) const {
541 if (hypotheses_.empty())

Callers 5

SmearMethod · 0.80
MarkStrongEvidenceFunction · 0.80
ModelStrongEvidenceFunction · 0.80
RowIsStrandedFunction · 0.80

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected