Workflow: sparse partial checkout (code and _incoming only), book lookup before processing, safe rebase retry; revert cancel-in-progress
This commit is contained in:
@@ -85,11 +85,12 @@ def align(raw_lines, boxes, window=8):
|
||||
return result
|
||||
|
||||
|
||||
def units(pdf):
|
||||
def units(pdf, first_pages=None):
|
||||
"""Reading units in order: [{'pdf_page', 'half', 'text', 'geom'}]. Text keeps the layout (indentation, hyphens).
|
||||
'geom' is parallel to text.split('\\n'): the position of each line on the page (see align)."""
|
||||
result = []
|
||||
for p, (w, h) in enumerate(page_geometry(pdf), start=1):
|
||||
geo = page_geometry(pdf)
|
||||
for p, (w, h) in enumerate(geo[:first_pages] if first_pages else geo, start=1):
|
||||
boxes = page_lines(pdf, p)
|
||||
for half, x, width in halves(w, h):
|
||||
text = _run(["pdftotext", "-layout", "-f", str(p), "-l", str(p),
|
||||
|
||||
Reference in New Issue
Block a user