1411 {
1412 CalculateOpenModels(row_start_, row_end_);
1413
1414
1415
1416
1417 for (
int i = row_start_;
i < row_end_;
i++) {
1418 RowScratchRegisters &row = (*rows_)[
i];
1419 if (row.ri_->num_words == 0) {
1420 continue;
1421 }
1422
1423
1424
1425
1426
1427 bool left_align_open = false;
1428 bool right_align_open = false;
1429 for (
auto &m : OpenModels(
i)) {
1430 switch (m->justification()) {
1432 left_align_open = true;
1433 break;
1435 right_align_open = true;
1436 break;
1437 default:
1438 left_align_open = right_align_open = true;
1439 }
1440 }
1441
1442
1443
1444 bool likely_start;
1446 likely_start = true;
1447 } else {
1448 if ((left_align_open && right_align_open) || (!left_align_open && !right_align_open)) {
1451 } else if (left_align_open) {
1453 } else {
1455 }
1456 }
1457
1458
1459
1460
1461
1462 if (likely_start) {
1463
1464 for (
unsigned m = 0; m < OpenModels(
i).size(); m++) {
1466 row.AddStartLine(OpenModels(
i)[m]);
1467 }
1468 }
1469 } else {
1470
1473 (*rows_)[
i - 1].StrongHypotheses(&last_line_models);
1474 } else {
1476 }
1477 for (auto model : last_line_models) {
1479 row.AddBodyLine(model);
1480 }
1481 }
1482 }
1483
1484
1485
1486
1487
1489 (row.GetLineType() ==
LT_START && !row.UniqueStartHypothesis())) {
1492 for (auto &all_model : all_models) {
1494 row.AddStartLine(all_model);
1495 }
1496 }
1497 }
1498
1499
1500
1502 CalculateOpenModels(
i + 1, row_end_);
1503 }
1504 }
1505}
std::vector< const ParagraphModel * > SetOfModels
bool ValidBodyLine(const std::vector< RowScratchRegisters > *rows, int row, const ParagraphModel *model)
bool ValidFirstLine(const std::vector< RowScratchRegisters > *rows, int row, const ParagraphModel *model)
void NonCenteredModels(SetOfModels *models)