We examine rows[row_start, row_end) and do the following: (1) Clear all existing hypotheses for the rows being considered. (2) Mark up any rows as exceptionally likely to be paragraph starts or paragraph body lines as such using both geometric and textual clues. (3) Form models for any sequence of start + continuation lines. (4) Smear the paragraph models to cover surrounding text.
| 1993 | // (3) Form models for any sequence of start + continuation lines. |
| 1994 | // (4) Smear the paragraph models to cover surrounding text. |
| 1995 | void StrongEvidenceClassify(int debug_level, |
| 1996 | GenericVector<RowScratchRegisters> *rows, |
| 1997 | int row_start, int row_end, |
| 1998 | ParagraphTheory *theory) { |
| 1999 | if (!AcceptableRowArgs(debug_level, 2, __func__, rows, row_start, row_end)) |
| 2000 | return; |
| 2001 | |
| 2002 | if (debug_level > 1) { |
| 2003 | tprintf("#############################################\n"); |
| 2004 | tprintf("# StrongEvidenceClassify( rows[%d:%d) )\n", row_start, row_end); |
| 2005 | tprintf("#############################################\n"); |
| 2006 | } |
| 2007 | |
| 2008 | RecomputeMarginsAndClearHypotheses(rows, row_start, row_end, 10); |
| 2009 | MarkStrongEvidence(rows, row_start, row_end); |
| 2010 | |
| 2011 | DebugDump(debug_level > 2, "Initial strong signals.", *theory, *rows); |
| 2012 | |
| 2013 | // Create paragraph models. |
| 2014 | ModelStrongEvidence(debug_level, rows, row_start, row_end, false, theory); |
| 2015 | |
| 2016 | DebugDump(debug_level > 2, "Unsmeared hypotheses.s.", *theory, *rows); |
| 2017 | |
| 2018 | // At this point, some rows are marked up as paragraphs with model numbers, |
| 2019 | // and some rows are marked up as either LT_START or LT_BODY. Now let's |
| 2020 | // smear any good paragraph hypotheses forward and backward. |
| 2021 | ParagraphModelSmearer smearer(rows, row_start, row_end, theory); |
| 2022 | smearer.Smear(); |
| 2023 | } |
| 2024 | |
| 2025 | void SeparateSimpleLeaderLines(GenericVector<RowScratchRegisters> *rows, |
| 2026 | int row_start, int row_end, |
no test coverage detected