7f0b598441
Root cause: clean-up found paragraph breaks from the layout indent of pdftotext -layout
(columns, relative to the smallest indent in the whole chapter). Chapter 1 happened to
have a clean left margin; later pages are skewed and drift 1-2 columns, drop caps push
the first lines right by varying amounts, and some pages wrap text around a label, so
continuation lines were taken as paragraph starts (a blank line inside a sentence).
Fix (all deterministic, all logged to warnings.log):
- pdftext: read each line's position in points (pdftotext -bbox-layout) and attach it to
the layout line it belongs to (units() now carries 'geom'; merged/partial lines get none).
- cleanup: a paragraph starts when a line sits >= 4.5 pt right of the line before it, or
>= 2.5 pt lower than the page's normal line pitch. A line without a position or starting
in lower case never starts a paragraph. Text wrapped beside a drop cap is not a start.
Without positions the old indent rule is still used.
- cleanup: drop cap + small caps on ONE layout line ('F OR MANY YEARS') is repaired like
the two-line form (chapters 4 and 5).
- pageparts.header_zone: the running header is found even when text follows it without a
blank line, and the right-hand header (chapter title, page number sometimes misread as
't5' or 'a') is recognised from the chapter title.
- cleanup: all-capitals lines below the text are captions (removed); an all-capitals line
above the text is kept as a section heading in title case ('The Deferred Preface');
'Right: MARK TWIN' style captions removed; '5. JOY' labels set inside a sentence removed.
- cleanup: paragraph starting with a lone quote mark + lower-case word joins the paragraph
before it; paragraph-leading ' + capital becomes '"' (not elisions such as 'Tis); a bullet
in place of an opening quote becomes '"'; closing quote with no opening quote, and a '1'
that is probably the letter I, are logged only.
- cleanup: mid-line 'worth- while' joined only when certain, otherwise logged.
- tests: new _pipeline/tests/test_cleanup.py (36 tests, 27 fail on the previous code);
test_pipeline.py helper test_piece renamed make_test_piece so pytest stops collecting it.
Chapter 1 text is byte-identical to the approved pilot text.
Re-run for chapters 1-6: cleanup, figures, script, license. Text, script, warnings and
book.json for chapters 2-6 added.
3.7 KiB
3.7 KiB
Skipped figures
Figures support the concept only, and nothing in a figure is read aloud unless a spoken sentence is approved. No spoken figure sentence is approved for this book yet, so every figure below is skipped.
Scope: chapters 1, 2, 3, 4, 5, 6.
- Chapter 1, pdf page 4 (left half), book page unnumbered: image 359 x 547 pt on the page. Caption: Walter Russell. Caption source: caption printed on the page (LEFT: WALTER RUSSELL). Reason skipped: no approved spoken sentence.
- Chapter 1, pdf page 5 (right half), book page 3: image 175 x 215 pt on the page. Caption: Ossip Gabrilowitsch. Caption source: table of contents picture list, page 3. Reason skipped: no approved spoken sentence.
- Chapter 2, pdf page 9 (left half), book page 10: image 351 x 549 pt on the page. Caption: Franklin Roosevelt Before Pearl Harbor. Caption source: table of contents picture list, page 10. Reason skipped: no approved spoken sentence.
- Chapter 3, pdf page 9 (left half), book page 10: image 351 x 549 pt on the page. Caption: Franklin Roosevelt Before Pearl Harbor. Caption source: table of contents picture list, page 10. Reason skipped: no approved spoken sentence.
- Chapter 3, pdf page 13 (left half), book page 18: image 374 x 547 pt on the page. Caption: Thomas A. Edison. Caption source: table of contents picture list, page 18. Reason skipped: no approved spoken sentence.
- Chapter 3, pdf page 15 (left half), book page 22: image 272 x 148 pt on the page. Caption: Home Of Walter And Lao Russell. Caption source: table of contents picture list, page 22. Reason skipped: no approved spoken sentence.
- Chapter 3, pdf page 15 (right half), book page 23: image 373 x 549 pt on the page. Caption: Charles Goodyear—The Artist At Work. Caption source: table of contents picture list, page 23. Reason skipped: no approved spoken sentence.
- Chapter 4, pdf page 18 (left half), book page 28: image 365 x 360 pt on the page. Caption: The Mark Twain Monument. Caption source: table of contents picture list, page 28. Reason skipped: no approved spoken sentence.
- Chapter 4, pdf page 18 (right half), book page 29: image 372 x 353 pt on the page. Caption: none found. Caption source: none. Reason skipped: no approved spoken sentence.
- Chapter 4, pdf page 22 (left half), book page 36: image 171 x 162 pt on the page. Caption: Tom Sawyer. Caption source: table of contents picture list, page 36. Reason skipped: no approved spoken sentence.
- Chapter 5, pdf page 22 (left half), book page 36: image 171 x 162 pt on the page. Caption: Tom Sawyer. Caption source: table of contents picture list, page 36. Reason skipped: no approved spoken sentence.
- Chapter 5, pdf page 23 (right half), book page 39: image 381 x 522 pt on the page. Caption: Franklindelanorooseveltafterpearlharbor. Caption source: caption printed on the page (RIGHT:FRANKLINDELANOROOSEVELTAFTERPEARLHARBOR). Reason skipped: no approved spoken sentence.
- Chapter 5, pdf page 27 (right half), book page 47: image 375 x 532 pt on the page. Caption: Mark Twain. Caption source: table of contents picture list, page 47. Reason skipped: no approved spoken sentence.
- Chapter 6, pdf page 32 (left half), book page 56: image 376 x 553 pt on the page. Caption: The Four Freedoms. Caption source: table of contents picture list, page 56. Reason skipped: no approved spoken sentence.
- Chapter 6, pdf page 33 (left half), book page 58: image 374 x 541 pt on the page. Caption: none found. Caption source: none. Reason skipped: no approved spoken sentence.
- Chapter 6, pdf page 34 (left half), book page 60: image 365 x 511 pt on the page. Caption: none found. Caption source: none. Reason skipped: no approved spoken sentence.