raw2md 0.2.2__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/workflows/ci.yml +3 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/workflows/smoke.yml +8 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/AGENTS.md +31 -10
- raw2md-0.4.0/CHANGELOG.md +126 -0
- raw2md-0.4.0/NOTICE +329 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/PKG-INFO +63 -46
- {raw2md-0.2.2 → raw2md-0.4.0}/README.md +56 -42
- {raw2md-0.2.2 → raw2md-0.4.0}/SECURITY.md +8 -3
- raw2md-0.4.0/benchmarks/README.md +49 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/README.md +6 -5
- raw2md-0.4.0/benchmarks/mpdocbench/results/all.yaml +46 -0
- raw2md-0.4.0/benchmarks/mpdocbench/results/english.yaml +48 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/cli.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/pins.py +5 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/report.py +15 -14
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/scoring.py +169 -65
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/pins.yaml +13 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/docs/cleaning.md +202 -16
- {raw2md-0.2.2 → raw2md-0.4.0}/docs/inspection.md +2 -2
- raw2md-0.4.0/docs/quality.md +268 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/docs/reference.md +186 -29
- {raw2md-0.2.2 → raw2md-0.4.0}/examples/README.md +31 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/examples/book.md +1145 -1634
- {raw2md-0.2.2 → raw2md-0.4.0}/examples/report.md +14 -15
- {raw2md-0.2.2 → raw2md-0.4.0}/examples/thesis.md +575 -644
- raw2md-0.4.0/notes/notes.md +34 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/pyproject.toml +62 -24
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaner.py +49 -9
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/__init__.py +14 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/headings.py +608 -49
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/lists.py +182 -10
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/math.py +8 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/ocr.py +44 -16
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/options.py +6 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/prose.py +657 -37
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/segments.py +6 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/tables.py +465 -13
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/doctor.py +5 -5
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/base.py +8 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/bundled.py +84 -10
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/djvu.py +23 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/pdfium.py +16 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/header.py +26 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/init.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/keywords.py +4 -50
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/__init__.py +7 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/base.py +30 -5
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/claude.py +5 -77
- raw2md-0.4.0/src/raw2md/llm/codex.py +469 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/factory.py +8 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/ocr.py +143 -8
- raw2md-0.4.0/src/raw2md/llm/openrouter.py +471 -0
- raw2md-0.4.0/src/raw2md/llm/process.py +84 -0
- raw2md-0.4.0/src/raw2md/mdtext/seams.py +142 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/tables.py +51 -10
- raw2md-0.4.0/src/raw2md/mdtext/words.py +55 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/media.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/orchestrator.py +12 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/pipeline.py +98 -34
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/progress.py +109 -12
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/prompts.py +96 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/quality/evaluator.py +644 -259
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/quality/headings.py +68 -34
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/settings.py +114 -27
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/builders/__init__.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/builders/document.py +13 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/builders/layout.py +8 -9
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/builders/line.py +22 -20
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/builders/ocr.py +241 -45
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/builders/structure.py +28 -14
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/converters/__init__.py +14 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/converters/pdf.py +29 -20
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/models.py +18 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/output.py +1 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/__init__.py +4 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/blockquote.py +19 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/code.py +3 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/debug.py +14 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/document_toc.py +10 -7
- raw2md-0.4.0/src/raw2md_engine/marker/processors/equation.py +197 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/footnote.py +1 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/ignoretext.py +58 -14
- raw2md-0.4.0/src/raw2md_engine/marker/processors/image_furniture.py +77 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/line_numbers.py +42 -18
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/list.py +55 -15
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/order.py +5 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/sectionheader.py +21 -11
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/table.py +204 -122
- raw2md-0.4.0/src/raw2md_engine/marker/processors/table_merge.py +500 -0
- raw2md-0.4.0/src/raw2md_engine/marker/processors/text.py +245 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/providers/__init__.py +7 -12
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/providers/pdf.py +57 -38
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/renderers/__init__.py +6 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/renderers/html.py +8 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/renderers/markdown.py +58 -34
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/__init__.py +1 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/__init__.py +3 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/base.py +50 -44
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/basetable.py +7 -17
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/complexregion.py +5 -13
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/equation.py +5 -11
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/figure.py +1 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/form.py +0 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/handwriting.py +3 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/inlinemath.py +1 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/listitem.py +2 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/picture.py +1 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/sectionheader.py +1 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/table.py +3 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/tablecell.py +4 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/text.py +1 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/document.py +9 -9
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/base.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/page.py +47 -24
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/table.py +1 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/polygon.py +69 -39
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/registry.py +5 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/text/line.py +14 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/text/span.py +27 -29
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/settings.py +4 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/util.py +74 -37
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/utils/image.py +10 -12
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/extraction.py +95 -30
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/pdf/chars.py +48 -28
- raw2md-0.4.0/src/raw2md_engine/pdftext/pdf/links.py +190 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/pdf/pages.py +154 -72
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/pdf/utils.py +13 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/postprocessing.py +10 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/schema.py +38 -73
- raw2md-0.4.0/src/raw2md_engine/pdftext/tables.py +172 -0
- raw2md-0.4.0/src/raw2md_engine/surya/common/__init__.py +1 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/adetr/decoder.py +21 -26
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/donut/encoder.py +41 -44
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/donut/processor.py +20 -20
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/load.py +7 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/polygon.py +8 -9
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/predictor.py +5 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/pretrained.py +2 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/__init__.py +38 -30
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/config.py +2 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/decoder/__init__.py +36 -40
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/embedder/__init__.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/encoder/__init__.py +16 -17
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/flash_attn_utils.py +43 -15
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/processor/__init__.py +21 -21
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/processor/schema.py +4 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/processor/tokenizer.py +72 -72
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/util.py +7 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/xla.py +1 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/__init__.py +8 -9
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/heatmap.py +4 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/loader.py +10 -11
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/model/config.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/model/encoderdecoder.py +45 -48
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/parallel.py +1 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/processor.py +52 -40
- raw2md-0.4.0/src/raw2md_engine/surya/detection/schema.py +12 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/util.py +5 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/foundation/__init__.py +38 -37
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/foundation/cache/dynamic_ops.py +13 -12
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/foundation/cache/static_ops.py +11 -10
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/foundation/loader.py +7 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/foundation/util.py +6 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/input/processing.py +2 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/layout/__init__.py +6 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/layout/schema.py +3 -5
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/logging.py +1 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/__init__.py +3 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/loader.py +5 -5
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/model/config.py +2 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/model/encoder.py +40 -48
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/schema.py +2 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/tokenizer.py +57 -32
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/recognition/__init__.py +48 -51
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/recognition/postprocessing.py +4 -5
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/recognition/schema.py +7 -10
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/recognition/util.py +31 -19
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/settings.py +10 -10
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/__init__.py +201 -106
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/loader.py +6 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/model/config.py +29 -25
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/model/decoder.py +47 -23
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/model/encoder.py +34 -17
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/model/encoderdecoder.py +13 -14
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/processor.py +27 -30
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/schema.py +9 -11
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/shaper.py +36 -35
- raw2md-0.4.0/tests/cleaning/test_dollar_columns.py +81 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_findings.py +17 -5
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_heading_levels.py +570 -7
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_heading_recovery.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_headings.py +52 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_lists.py +111 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_math.py +28 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_ocr.py +64 -9
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_prose.py +122 -1
- raw2md-0.4.0/tests/cleaning/test_prose_cut_paragraphs.py +358 -0
- raw2md-0.4.0/tests/cleaning/test_prose_guards.py +33 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_prose_rejoin.py +143 -0
- raw2md-0.4.0/tests/cleaning/test_table_leaders.py +77 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/test_tables.py +339 -8
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/conftest.py +19 -3
- raw2md-0.4.0/tests/engine/_helpers.py +119 -0
- raw2md-0.4.0/tests/engine/conftest.py +16 -0
- raw2md-0.4.0/tests/engine/test_block_lines.py +86 -0
- raw2md-0.4.0/tests/engine/test_continuation_join.py +70 -0
- raw2md-0.4.0/tests/engine/test_default_processors.py +24 -0
- raw2md-0.4.0/tests/engine/test_equation_text.py +134 -0
- raw2md-0.4.0/tests/engine/test_heading_bold.py +23 -0
- raw2md-0.4.0/tests/engine/test_heading_levels.py +104 -0
- raw2md-0.4.0/tests/engine/test_image_furniture.py +102 -0
- raw2md-0.4.0/tests/engine/test_imports.py +79 -0
- raw2md-0.4.0/tests/engine/test_layer_reread.py +414 -0
- raw2md-0.4.0/tests/engine/test_line_geometry.py +134 -0
- raw2md-0.4.0/tests/engine/test_line_hyphens.py +56 -0
- raw2md-0.4.0/tests/engine/test_links.py +70 -0
- raw2md-0.4.0/tests/engine/test_list_bullet.py +31 -0
- raw2md-0.4.0/tests/engine/test_list_nesting.py +118 -0
- raw2md-0.4.0/tests/engine/test_math_escape.py +34 -0
- raw2md-0.4.0/tests/engine/test_math_merge.py +23 -0
- raw2md-0.4.0/tests/engine/test_paragraph_join.py +696 -0
- raw2md-0.4.0/tests/engine/test_paragraph_tail.py +28 -0
- raw2md-0.4.0/tests/engine/test_phase_callback.py +115 -0
- raw2md-0.4.0/tests/engine/test_picture_lines.py +106 -0
- raw2md-0.4.0/tests/engine/test_render_html.py +28 -0
- raw2md-0.4.0/tests/engine/test_running_headers.py +118 -0
- raw2md-0.4.0/tests/engine/test_scan_pages.py +140 -0
- raw2md-0.4.0/tests/engine/test_span_formats.py +96 -0
- raw2md-0.4.0/tests/engine/test_span_scripts.py +74 -0
- raw2md-0.4.0/tests/engine/test_table_cell_lines.py +197 -0
- raw2md-0.4.0/tests/engine/test_table_columns.py +111 -0
- raw2md-0.4.0/tests/engine/test_table_merge.py +522 -0
- raw2md-0.4.0/tests/engine/test_table_pipe.py +35 -0
- raw2md-0.4.0/tests/engine/test_table_separator.py +19 -0
- raw2md-0.4.0/tests/engine/test_text_width.py +45 -0
- raw2md-0.4.0/tests/engine/test_tokenizer_fallback.py +57 -0
- raw2md-0.4.0/tests/engine/test_transformers_modules.py +47 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/fixtures/offline/settings.json +2 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/fixtures/real/prompts.yaml +110 -4
- raw2md-0.4.0/tests/fixtures/real/settings.json +57 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/inspection/_helpers.py +2 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/post/_helpers.py +1 -1
- raw2md-0.4.0/tests/synthesis/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/test_llm_live.py +154 -16
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/test_roundtrip.py +31 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_cleaner.py +31 -0
- raw2md-0.4.0/tests/test_codex.py +664 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_doctor.py +14 -12
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_engine_copy.py +137 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_engines.py +240 -6
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_fixtures_config.py +12 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_header.py +69 -3
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_init.py +23 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_inspection_chunking.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_keywords.py +0 -58
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_llm.py +51 -51
- raw2md-0.4.0/tests/test_mdtext_seams.py +219 -0
- raw2md-0.4.0/tests/test_mdtext_tables.py +62 -0
- raw2md-0.4.0/tests/test_mdtext_words.py +57 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_media.py +13 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_mpdocbench.py +204 -27
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_no_network.py +30 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_ocr.py +194 -1
- raw2md-0.4.0/tests/test_openrouter.py +738 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_orchestrator.py +76 -16
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_pipeline.py +182 -15
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_progress.py +233 -14
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_prompts.py +91 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_quality.py +749 -68
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_queue.py +4 -4
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_settings.py +228 -34
- raw2md-0.2.2/CHANGELOG.md +0 -73
- raw2md-0.2.2/NOTICE +0 -76
- raw2md-0.2.2/benchmarks/README.md +0 -39
- raw2md-0.2.2/benchmarks/mpdocbench/results/all.yaml +0 -68
- raw2md-0.2.2/benchmarks/mpdocbench/results/english.yaml +0 -70
- raw2md-0.2.2/docs/quality.md +0 -179
- raw2md-0.2.2/notes/notes.md +0 -10
- raw2md-0.2.2/src/raw2md_engine/marker/processors/blank_page.py +0 -76
- raw2md-0.2.2/src/raw2md_engine/marker/processors/block_relabel.py +0 -85
- raw2md-0.2.2/src/raw2md_engine/marker/processors/equation.py +0 -145
- raw2md-0.2.2/src/raw2md_engine/marker/processors/line_merge.py +0 -130
- raw2md-0.2.2/src/raw2md_engine/marker/processors/reference.py +0 -54
- raw2md-0.2.2/src/raw2md_engine/marker/processors/text.py +0 -100
- raw2md-0.2.2/src/raw2md_engine/marker/schema/blocks/reference.py +0 -16
- raw2md-0.2.2/src/raw2md_engine/pdftext/pdf/links.py +0 -232
- raw2md-0.2.2/src/raw2md_engine/pdftext/tables.py +0 -111
- raw2md-0.2.2/src/raw2md_engine/surya/common/__init__.py +0 -3
- raw2md-0.2.2/src/raw2md_engine/surya/detection/schema.py +0 -12
- raw2md-0.2.2/tests/fixtures/real/settings.json +0 -39
- {raw2md-0.2.2 → raw2md-0.4.0}/.gitattributes +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/ISSUE_TEMPLATE/docs.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/ISSUE_TEMPLATE/feature.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/ISSUE_TEMPLATE/quality.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/ISSUE_TEMPLATE/task.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/pull_request_template.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/release.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/scripts/check-smoke-result.sh +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/workflows/docs.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.github/workflows/release.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/.gitignore +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/LICENSE +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/THIRD_PARTY_NOTICES.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/run.sh +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/convert.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/fetch.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/mpdocbench/pdfs.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/run.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/scorer/requirements.txt +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/benchmarks/mpdocbench/scripts/scorer/setup.sh +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/codecov.yml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/docs/README.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/docs/assets/raw2md-logo.svg +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/docs/post.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/examples/MODEL_LICENSE +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/.gitkeep +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/__main__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cleaning/findings.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/cli.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/config.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/pandoc.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/pandoc_tables.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/preflight.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/signature.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/engines/weights.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/exit_codes.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/katex.min.js +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/katex.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/keywords.yaml +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/acceptance.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/chunking.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/edit_guard.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/gemini.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/addressing.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/apply.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/common.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/coordinator.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/masking.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/numbering.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/inspection/reply.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/blocks.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/common.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/coordinator.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/ladder.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/spacing.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/post/tables.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/rpd.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/llm/trace.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/lock.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/logging_setup.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/formulas.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/lines.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/links.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/loops.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/math_spans.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/pages.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/mdtext/zones.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/output.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/paths.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/quality/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/queue.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/service.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/source_outline.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/source_text.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md/temp.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/LICENSE +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/logger.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/processors/page_header.py +1 -1
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/providers/utils.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/caption.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/code.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/footnote.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/pagefooter.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/pageheader.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/blocks/toc.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/__init__.py +2 -2
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/figure.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/list.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/groups/picture.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/text/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/schema/text/char.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/marker/utils/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/LICENSE +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/pdftext/settings.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/LICENSE +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/s3.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/decoder/config.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/encoder/config.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/common/surya/schema.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/detection/model/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/foundation/cache/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/layout/label.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/ocr_error/model/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/src/raw2md_engine/surya/table_rec/model/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/.gitkeep +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/cleaning/_helpers.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/README.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/chart-2.png +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/chart-3.png +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/chart.png +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/diagram (v2).png +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/fonts/Caveat-Regular.ttf +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/fonts/OFL.txt +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/fonts/sources.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/assets/sample.png +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/chart_series.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/engineering_prose.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/footnotes.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/formulas.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/handwriting.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/headers.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/images.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/long_doc.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/math_legend.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/mixed.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/multilang.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/multiline_display_math.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/nested_lists.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/single_glyph_math.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/table_formulas.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/table_math_pipes.md +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/corpus/tables.md +0 -0
- {raw2md-0.2.2/tests/inspection → raw2md-0.4.0/tests/engine}/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/fixtures/offline/prompts.yaml +0 -0
- {raw2md-0.2.2/tests/post → raw2md-0.4.0/tests/inspection}/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/inspection/test_addressing.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/inspection/test_apply.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/inspection/test_coordinator.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/inspection/test_masking.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/inspection/test_reply.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/pdf_fixtures.py +0 -0
- {raw2md-0.2.2/tests/synthesis → raw2md-0.4.0/tests/post}/__init__.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/post/test_blocks.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/post/test_coordinator.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/post/test_ladder.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/post/test_spacing.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/post/test_tables.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/_degrade.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/_paths.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/_structure.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/gen_djvu.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/gen_docx.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/gen_pdf.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/gen_scan.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/gen_smoke.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/generate.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/roundtrip.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/runner.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/test_corpus_fast.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/test_structure.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/synthesis/test_synthesis.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_acceptance.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_cli.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_comment_length.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_edit_guard.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_entry_point.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_katex.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_llm_trace.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_lock.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_logging_setup.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_output.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_pandoc_media.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_rpd.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_source_outline.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_source_text.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_temp.py +0 -0
- {raw2md-0.2.2 → raw2md-0.4.0}/tests/test_weights.py +0 -0
|
@@ -2,7 +2,7 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
# No test reads these paths, and docs.yml lints the Markdown. A run holds
|
|
5
|
-
#
|
|
5
|
+
# ten runners for minutes, and the next push queues behind it.
|
|
6
6
|
# tests/corpus/ Markdown is absent on purpose: the fast layer reads it. A
|
|
7
7
|
# new top-level folder joins the list only if no test reads it. The list is
|
|
8
8
|
# written twice: GitHub Actions does not resolve YAML anchors.
|
|
@@ -44,7 +44,7 @@ jobs:
|
|
|
44
44
|
fail-fast: false
|
|
45
45
|
matrix:
|
|
46
46
|
os: [ubuntu-24.04, windows-2025]
|
|
47
|
-
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
47
|
+
python: ["3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
48
48
|
include:
|
|
49
49
|
- os: ubuntu-24.04
|
|
50
50
|
python: "3.12"
|
|
@@ -77,13 +77,13 @@ jobs:
|
|
|
77
77
|
--no-install-package cuda-pathfinder
|
|
78
78
|
--no-install-package cuda-toolkit
|
|
79
79
|
--no-install-package nvidia-cublas
|
|
80
|
+
--no-install-package nvidia-cuda-cccl
|
|
80
81
|
--no-install-package nvidia-cuda-cupti
|
|
81
82
|
--no-install-package nvidia-cuda-nvrtc
|
|
82
83
|
--no-install-package nvidia-cuda-runtime
|
|
83
84
|
--no-install-package nvidia-cudnn-cu13
|
|
84
85
|
--no-install-package nvidia-cufft
|
|
85
86
|
--no-install-package nvidia-cufile
|
|
86
|
-
--no-install-package nvidia-curand
|
|
87
87
|
--no-install-package nvidia-cusolver
|
|
88
88
|
--no-install-package nvidia-cusparse
|
|
89
89
|
--no-install-package nvidia-cusparselt-cu13
|
|
@@ -31,11 +31,14 @@ concurrency:
|
|
|
31
31
|
jobs:
|
|
32
32
|
install:
|
|
33
33
|
# `uv tool install` reads no lock file, so a dependency upgrade breaks a
|
|
34
|
-
# user here first. DOCX converts in a second without a GPU or models.
|
|
34
|
+
# user here first. DOCX converts in a second without a GPU or models. The
|
|
35
|
+
# floor and the ceiling of requires-python: the fast layer in CI skips
|
|
36
|
+
# torch, so only this job installs its wheel for each end of the range.
|
|
35
37
|
strategy:
|
|
36
38
|
fail-fast: false
|
|
37
39
|
matrix:
|
|
38
40
|
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025]
|
|
41
|
+
python: ["3.11", "3.15"]
|
|
39
42
|
runs-on: ${{ matrix.os }}
|
|
40
43
|
timeout-minutes: 20
|
|
41
44
|
defaults:
|
|
@@ -47,7 +50,7 @@ jobs:
|
|
|
47
50
|
- uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
|
|
48
51
|
with:
|
|
49
52
|
enable-cache: true
|
|
50
|
-
python-version:
|
|
53
|
+
python-version: ${{ matrix.python }}
|
|
51
54
|
|
|
52
55
|
- name: Ensure pandoc
|
|
53
56
|
# The docx target needs pandoc 3.1.9+; the Ubuntu 24.04 package is
|
|
@@ -119,7 +122,8 @@ jobs:
|
|
|
119
122
|
|
|
120
123
|
pdf:
|
|
121
124
|
# raw2md-engine on a CPU runner, one platform only: gigabytes of models and
|
|
122
|
-
# minutes of inference. Proves the required engine runs without a GPU.
|
|
125
|
+
# minutes of inference. Proves the required engine runs without a GPU. On the
|
|
126
|
+
# ceiling of requires-python, because the newest Python gets wheels last.
|
|
123
127
|
runs-on: ubuntu-24.04
|
|
124
128
|
timeout-minutes: 45
|
|
125
129
|
defaults:
|
|
@@ -131,7 +135,7 @@ jobs:
|
|
|
131
135
|
- uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
|
|
132
136
|
with:
|
|
133
137
|
enable-cache: true
|
|
134
|
-
python-version: "3.
|
|
138
|
+
python-version: "3.15"
|
|
135
139
|
|
|
136
140
|
# The engine weights folder; bump the key suffix to refresh it.
|
|
137
141
|
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
@@ -14,7 +14,7 @@ one file at a time, in these stages:
|
|
|
14
14
|
|
|
15
15
|
| Stage | When it runs | What it does |
|
|
16
16
|
|---|---|---|
|
|
17
|
-
| Conversion | always, except for a Markdown source | converts the source with `raw2md-engine` (PDF), `pandoc` (DOCX), DjVuLibre and `raw2md-engine` (DjVu), or Gemini (`-e`) |
|
|
17
|
+
| Conversion | always, except for a Markdown source | converts the source with `raw2md-engine` (PDF), `pandoc` (DOCX), DjVuLibre and `raw2md-engine` (DjVu), or a vision model, Gemini or Codex (`-e`) |
|
|
18
18
|
| Cleaning | always | repairs defects with deterministic rules |
|
|
19
19
|
| Inspection | with `-i`, for PDF and DjVu | compares the text with the source pages through a large language model (LLM) |
|
|
20
20
|
| Post-processing | with `-p` | repairs damaged markup through an LLM |
|
|
@@ -30,7 +30,7 @@ The guide to each stage is in `docs/`.
|
|
|
30
30
|
| `src/raw2md/orchestrator.py`, `queue.py`, `lock.py` | the run: the lock, the queue, resume, and the exit code |
|
|
31
31
|
| `src/raw2md/pipeline.py` | the stages of one file |
|
|
32
32
|
| `src/raw2md/engines/` | the conversion engines; `base.py` holds their interface, `bundled.py` is the adapter of `raw2md-engine`, and `weights.py` downloads its weights |
|
|
33
|
-
| `src/raw2md_engine/` | `raw2md-engine`: a
|
|
33
|
+
| `src/raw2md_engine/` | `raw2md-engine`: a modified copy of `marker`, `surya`, and `pdftext`, with the upstream layout and names; `NOTICE` describes the changes |
|
|
34
34
|
| `src/raw2md/cleaner.py` | the entry points of cleaning and the order of its passes |
|
|
35
35
|
| `src/raw2md/cleaning/` | the cleaning rules, grouped by the object that they repair: headings, lists, tables, formulas, and prose |
|
|
36
36
|
| `src/raw2md/mdtext/` | the Markdown readers that all stages share: protected zones, lines, tables, and formulas |
|
|
@@ -40,14 +40,14 @@ The guide to each stage is in `docs/`.
|
|
|
40
40
|
| `src/raw2md/keywords.yaml` | the words that the cleaning rules look for |
|
|
41
41
|
| `src/raw2md/prompts.py` | the default prompts of the LLM stages |
|
|
42
42
|
| `src/raw2md/katex.min.js` | KaTeX, which checks that a formula is valid |
|
|
43
|
-
| `tests/` | the tests; `tests/cleaning/` holds the tests of `src/raw2md/cleaning/` |
|
|
43
|
+
| `tests/` | the tests; `tests/cleaning/` holds the tests of `src/raw2md/cleaning/`, and `tests/engine/` holds the tests of `src/raw2md_engine/` |
|
|
44
44
|
| `tests/corpus/`, `tests/synthesis/` | the reference Markdown and the round-trip harness |
|
|
45
45
|
| `benchmarks/` | the MPDocBench runner and its results |
|
|
46
46
|
| `examples/` | the conversion results of real documents |
|
|
47
47
|
|
|
48
48
|
## Setup
|
|
49
49
|
|
|
50
|
-
The project supports Python 3.11 to 3.
|
|
50
|
+
The project supports Python 3.11.5 to 3.15 on Linux and Windows.
|
|
51
51
|
|
|
52
52
|
The fast layer and the checks below do not need `torch`. For them, install a
|
|
53
53
|
light environment:
|
|
@@ -86,11 +86,24 @@ the task needs it:
|
|
|
86
86
|
the source. It uses `pandoc`, `xelatex`, DjVuLibre, and `raw2md-engine`,
|
|
87
87
|
which downloads its weights into `~/.raw2md/models` on the first run.
|
|
88
88
|
Without a GPU, the engine is very slow.
|
|
89
|
-
- `uv run pytest -m llm_live` sends real requests to Gemini
|
|
90
|
-
It spends the API quota
|
|
89
|
+
- `uv run pytest -m llm_live` sends real requests to Gemini, OpenRouter,
|
|
90
|
+
Claude Code, and Codex CLI. It spends the API quota and the plan limits. It
|
|
91
|
+
needs `GOOGLE_API_KEY`, `OPENROUTER_API_KEY`, and `claude` and `codex` on
|
|
92
|
+
`PATH`.
|
|
91
93
|
|
|
92
94
|
Both layers skip a test when its tool or its key is absent.
|
|
93
95
|
|
|
96
|
+
## Long conversions
|
|
97
|
+
|
|
98
|
+
A conversion with `raw2md-engine` can take minutes for each file. The
|
|
99
|
+
progress bars on stderr can stay the same for minutes during a long phase, and
|
|
100
|
+
in a pipe they come out as cursor movement sequences. To see that the run
|
|
101
|
+
continues, read `~/.raw2md/logs/raw2md.log` during the run. The log gets a
|
|
102
|
+
record at each new stage, at each new phase, and every 30 seconds. Do not pass
|
|
103
|
+
`--no-log-file`, because it turns these records off.
|
|
104
|
+
[docs/reference.md](docs/reference.md#console-and-log) gives the format of the
|
|
105
|
+
record.
|
|
106
|
+
|
|
94
107
|
## Conventions
|
|
95
108
|
|
|
96
109
|
- Cleaning is deterministic: the same input always gives the same output. A
|
|
@@ -113,10 +126,18 @@ Both layers skip a test when its tool or its key is absent.
|
|
|
113
126
|
length of comments and docstrings.
|
|
114
127
|
- Each `# noqa` and `# type: ignore` names its rule code and gives a reason.
|
|
115
128
|
- Test data is invented. Do not copy text from real documents into tests.
|
|
116
|
-
- `src/raw2md_engine/` is
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
129
|
+
- `src/raw2md_engine/` is code of raw2md that keeps the upstream layout.
|
|
130
|
+
Change it in place with a minimal diff, and do not reformat the rest of
|
|
131
|
+
the file. Give each fix a test in `tests/engine/`. `ruff` checks the copy,
|
|
132
|
+
minus the rules that `pyproject.toml` ignores for each subpackage.
|
|
133
|
+
`mypy` and the comment length test skip it.
|
|
134
|
+
- A test in `tests/engine/` imports the copy through its `engine` fixture,
|
|
135
|
+
which hides `torch`. A module of the copy that a test imports keeps
|
|
136
|
+
`import torch` out of its top level, because the CI install has no
|
|
137
|
+
`torch`.
|
|
138
|
+
- When you change a file in `src/raw2md_engine/`, set the date of the last
|
|
139
|
+
change in `NOTICE`. Add an item to the list of changes only for a new
|
|
140
|
+
kind of change. A changed file of `pdftext/` starts with the line
|
|
120
141
|
`# Modified by the raw2md authors. See NOTICE.`
|
|
121
142
|
|
|
122
143
|
## Issues and pull requests
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Each section holds the notes of one release, newest first. The GitHub release
|
|
4
|
+
of the version carries the same text.
|
|
5
|
+
|
|
6
|
+
## v0.4.0 - 2026-11-29
|
|
7
|
+
|
|
8
|
+
### Security
|
|
9
|
+
|
|
10
|
+
- Refuse the OpenRouter `:online` model variant, which turns on web search: an instruction in a document could make the model send the document text in a search query
|
|
11
|
+
|
|
12
|
+
### Bug fixes
|
|
13
|
+
|
|
14
|
+
- Fix four rules that change correct text, and keep the per-sample scores of MPDocBench ([#43](https://github.com/MikeDolg/raw2md/pull/43))
|
|
15
|
+
- Join cut paragraphs, level headings and lists by their numbers, and keep fullwidth punctuation ([#46](https://github.com/MikeDolg/raw2md/pull/46))
|
|
16
|
+
- Keep the text of formula blocks and of lines beside pictures, and drop repeated logos ([#47](https://github.com/MikeDolg/raw2md/pull/47))
|
|
17
|
+
- Join tables that a page break cuts, and repair table cell lines and rows ([#48](https://github.com/MikeDolg/raw2md/pull/48))
|
|
18
|
+
- Join more paragraphs and tables that the engine leaves cut ([#50](https://github.com/MikeDolg/raw2md/pull/50))
|
|
19
|
+
- Join cut paragraphs in caseless scripts, drop stray spaces, and relax the table join ([#52](https://github.com/MikeDolg/raw2md/pull/52))
|
|
20
|
+
- Repair attested tokens only on the text that the engine recognized ([#59](https://github.com/MikeDolg/raw2md/pull/59))
|
|
21
|
+
- Re-read the bad lines of a text layer on scan pages ([#61](https://github.com/MikeDolg/raw2md/pull/61))
|
|
22
|
+
- Exclude `lxml` 6.2.1, which has no Python 3.15 wheels, so that the install works on Python 3.15
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- Add a Codex CLI provider, and crop figures in LLM-OCR ([#55](https://github.com/MikeDolg/raw2md/pull/55))
|
|
27
|
+
- Add an OpenRouter provider for all LLM operations ([#58](https://github.com/MikeDolg/raw2md/pull/58))
|
|
28
|
+
|
|
29
|
+
### Documentation
|
|
30
|
+
|
|
31
|
+
- Drop the Python range from the `uv tool install` commands
|
|
32
|
+
- Publish the 0.4.0 benchmark scores, the examples, and the video memory use of the engine
|
|
33
|
+
|
|
34
|
+
### Maintenance
|
|
35
|
+
|
|
36
|
+
- Share the text tests and move text rules to the cleaning ([#54](https://github.com/MikeDolg/raw2md/pull/54))
|
|
37
|
+
- Move to torch 2.15 with CUDA 13.2 and support Python 3.15; the engine output changes ([#62](https://github.com/MikeDolg/raw2md/pull/62))
|
|
38
|
+
- Run the install smoke test on the lowest and the highest supported Python
|
|
39
|
+
|
|
40
|
+
Full changelog: <https://github.com/MikeDolg/raw2md/compare/v0.3.0...v0.4.0>
|
|
41
|
+
|
|
42
|
+
## v0.3.0 - 2026-11-06
|
|
43
|
+
|
|
44
|
+
### Bug fixes
|
|
45
|
+
|
|
46
|
+
- Fix the deterministic defects of the engine copy ([#26](https://github.com/MikeDolg/raw2md/pull/26))
|
|
47
|
+
- Stop two quality checks from failing correct output ([#30](https://github.com/MikeDolg/raw2md/pull/30))
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
- Grade each quality check and write a score to the header ([#31](https://github.com/MikeDolg/raw2md/pull/31))
|
|
52
|
+
- Save the engine's HTML and block tree in the .debug folder ([#32](https://github.com/MikeDolg/raw2md/pull/32))
|
|
53
|
+
- Show engine phase progress and log it for agents ([#35](https://github.com/MikeDolg/raw2md/pull/35))
|
|
54
|
+
- Move to torch 2.14 and current releases; the engine output changes ([#36](https://github.com/MikeDolg/raw2md/pull/36))
|
|
55
|
+
- Score Figure F1 and Overall in the MPDocBench benchmark ([#38](https://github.com/MikeDolg/raw2md/pull/38))
|
|
56
|
+
|
|
57
|
+
Full changelog: <https://github.com/MikeDolg/raw2md/compare/v0.2.2...v0.3.0>
|
|
58
|
+
|
|
59
|
+
## v0.2.2 - 2026-10-23
|
|
60
|
+
|
|
61
|
+
### Bug fixes
|
|
62
|
+
|
|
63
|
+
- Pin the Python range in the `uv tool install` commands, so that a default Python newer than 3.14 no longer picks an old release
|
|
64
|
+
|
|
65
|
+
### Maintenance
|
|
66
|
+
|
|
67
|
+
- Move the MPDocBench scorer to Python 3.14 and current pins ([#24](https://github.com/MikeDolg/raw2md/pull/24))
|
|
68
|
+
|
|
69
|
+
Full changelog: <https://github.com/MikeDolg/raw2md/compare/v0.2.1...v0.2.2>
|
|
70
|
+
|
|
71
|
+
## v0.2.1 - 2026-10-22
|
|
72
|
+
|
|
73
|
+
### Security
|
|
74
|
+
|
|
75
|
+
- Require fixed certifi and keep dev lock files out of the sdist ([#20](https://github.com/MikeDolg/raw2md/pull/20))
|
|
76
|
+
- Require Pillow 13.0.0 ([#22](https://github.com/MikeDolg/raw2md/pull/22))
|
|
77
|
+
|
|
78
|
+
Full changelog: <https://github.com/MikeDolg/raw2md/compare/v0.2.0...v0.2.1>
|
|
79
|
+
|
|
80
|
+
## v0.2.0 - 2026-10-20
|
|
81
|
+
|
|
82
|
+
### Bug fixes
|
|
83
|
+
|
|
84
|
+
- Check media asset names against the media folder ([#17](https://github.com/MikeDolg/raw2md/pull/17))
|
|
85
|
+
|
|
86
|
+
### Features
|
|
87
|
+
|
|
88
|
+
- feat: bundle the conversion engine as raw2md-engine ([#10](https://github.com/MikeDolg/raw2md/pull/10))
|
|
89
|
+
- Replace PyMuPDF with pypdfium2 for PDF analysis ([#14](https://github.com/MikeDolg/raw2md/pull/14))
|
|
90
|
+
|
|
91
|
+
### Maintenance
|
|
92
|
+
|
|
93
|
+
- Move to transformers 5 ([#15](https://github.com/MikeDolg/raw2md/pull/15))
|
|
94
|
+
- Keep the real subprocess.run in tests and run Windows CI on every Python ([#18](https://github.com/MikeDolg/raw2md/pull/18))
|
|
95
|
+
|
|
96
|
+
Full changelog: <https://github.com/MikeDolg/raw2md/compare/v0.1.1...v0.2.0>
|
|
97
|
+
|
|
98
|
+
## v0.1.1 - 2026-10-13
|
|
99
|
+
|
|
100
|
+
### Bug fixes
|
|
101
|
+
|
|
102
|
+
- fix(llm): isolate claude_cli and add the security policy ([#4](https://github.com/MikeDolg/raw2md/pull/4))
|
|
103
|
+
- fix(cleaning): fold edge punctuation of heading titles ([#7](https://github.com/MikeDolg/raw2md/pull/7))
|
|
104
|
+
- fix(cleaning): drop contents headings on continuation pages ([#8](https://github.com/MikeDolg/raw2md/pull/8))
|
|
105
|
+
|
|
106
|
+
### Maintenance
|
|
107
|
+
|
|
108
|
+
- Default claude_cli model: Sonnet 5.5 ([#2](https://github.com/MikeDolg/raw2md/pull/2))
|
|
109
|
+
|
|
110
|
+
Full changelog: <https://github.com/MikeDolg/raw2md/compare/v0.1.0...v0.1.1>
|
|
111
|
+
|
|
112
|
+
## v0.1.0 - 2026-10-06
|
|
113
|
+
|
|
114
|
+
raw2md 0.1.0 is the first public release.
|
|
115
|
+
|
|
116
|
+
raw2md is a command-line tool that converts PDF, DjVu, and DOCX documents into clean Markdown for RAG and other LLM pipelines. It runs the conversion with `marker`, `pandoc`, or Gemini, then repairs the defects that these engines leave in headings, tables, formulas, lists, and text. The cleaning uses deterministic rules and no LLM. Two optional LLM stages repair what the rules leave.
|
|
117
|
+
|
|
118
|
+
Install with [uv](https://docs.astral.sh/uv/getting-started/installation/):
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
uv tool install raw2md --torch-backend cu130
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Requirements: Python 3.11 to 3.13, Linux or Windows, and an NVIDIA GPU of the Turing generation or newer for `marker`. DOCX needs `pandoc` 3.1.9 or later, and DjVu needs DjVuLibre.
|
|
125
|
+
|
|
126
|
+
Documentation: <https://github.com/MikeDolg/raw2md/blob/main/docs/README.md>
|
raw2md-0.4.0/NOTICE
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
raw2md
|
|
2
|
+
Copyright (c) the raw2md authors
|
|
3
|
+
License: GPL-3.0-or-later (see LICENSE)
|
|
4
|
+
|
|
5
|
+
The package `raw2md_engine` in this distribution is a modified copy of the
|
|
6
|
+
software below. Datalab wrote the original packages. Datalab does not
|
|
7
|
+
endorse or support raw2md.
|
|
8
|
+
|
|
9
|
+
Original packages
|
|
10
|
+
-----------------
|
|
11
|
+
|
|
12
|
+
marker-pdf (package `marker`)
|
|
13
|
+
Author: Datalab
|
|
14
|
+
Repository: https://github.com/datalab-to/marker
|
|
15
|
+
Tag: v1.10.2
|
|
16
|
+
Commit: 5a41cdbac6232a10aaf4fad29f8e6c1a0c2a0808
|
|
17
|
+
License: GPL-3.0-or-later
|
|
18
|
+
Copy: src/raw2md_engine/marker/ (license text in LICENSE there)
|
|
19
|
+
|
|
20
|
+
surya-ocr (package `surya`)
|
|
21
|
+
Author: Datalab
|
|
22
|
+
Repository: https://github.com/datalab-to/surya
|
|
23
|
+
Tag: v0.17.1
|
|
24
|
+
Commit: 411fb1895a02ed629928d5ae59df96f44ac9dc41
|
|
25
|
+
License: GPL-3.0-or-later
|
|
26
|
+
Copy: src/raw2md_engine/surya/ (license text in LICENSE there)
|
|
27
|
+
|
|
28
|
+
pdftext
|
|
29
|
+
Author: Datalab
|
|
30
|
+
Repository: https://github.com/datalab-to/pdftext
|
|
31
|
+
Tag: v0.6.3
|
|
32
|
+
Commit: d76a57535d33e9467fd92c5d3c42d80d8c84f686
|
|
33
|
+
License: Apache-2.0
|
|
34
|
+
Copy: src/raw2md_engine/pdftext/ (license text in LICENSE there)
|
|
35
|
+
|
|
36
|
+
Changes
|
|
37
|
+
-------
|
|
38
|
+
|
|
39
|
+
The copy differs from the original packages in the ways below. The history
|
|
40
|
+
of the repository holds each change with its diff.
|
|
41
|
+
|
|
42
|
+
- The import paths `marker.`, `surya.`, and `pdftext.` are rewritten to
|
|
43
|
+
`raw2md_engine.marker.`, `raw2md_engine.surya.`, and
|
|
44
|
+
`raw2md_engine.pdftext.`.
|
|
45
|
+
- The parts that raw2md does not call are removed: the LLM pass, the
|
|
46
|
+
extraction converter, the config parser, the input formats other than
|
|
47
|
+
PDF, the output formats other than Markdown, and the command-line and
|
|
48
|
+
browser applications.
|
|
49
|
+
- The PDF converter builds its provider and its Markdown renderer
|
|
50
|
+
directly.
|
|
51
|
+
- The settings are fixed values. They do not load from environment
|
|
52
|
+
variables or from a `local.env` file.
|
|
53
|
+
- The copy downloads nothing: no font when the converter starts and no
|
|
54
|
+
model weights. `marker/models.py` takes the folder of the weights from
|
|
55
|
+
its caller.
|
|
56
|
+
- The models build their non-persistent buffers on the CPU, and the
|
|
57
|
+
loaders build them again after the load of the weights, before the move
|
|
58
|
+
to the device (2026-10-19). Changed files, under
|
|
59
|
+
src/raw2md_engine/surya/: `common/load.py`, `common/adetr/decoder.py`,
|
|
60
|
+
`common/surya/decoder/__init__.py`, `common/surya/encoder/__init__.py`,
|
|
61
|
+
`ocr_error/model/encoder.py`, `foundation/loader.py`,
|
|
62
|
+
`table_rec/loader.py`, and `ocr_error/loader.py`.
|
|
63
|
+
- The copy follows the API of transformers 5 (2026-10-19): the tied
|
|
64
|
+
weights as a mapping, `post_init` in every model, the default rotary
|
|
65
|
+
frequencies and the head mask in the copy itself, the tokenizer helpers
|
|
66
|
+
from their new module, and no head pruning or ONNX configuration.
|
|
67
|
+
Changed files, under src/raw2md_engine/surya/: `common/pretrained.py`,
|
|
68
|
+
`common/adetr/decoder.py`, `common/donut/encoder.py`,
|
|
69
|
+
`common/surya/__init__.py`, `common/surya/decoder/__init__.py`,
|
|
70
|
+
`common/surya/decoder/config.py`, `ocr_error/model/config.py`,
|
|
71
|
+
`ocr_error/model/encoder.py`, `ocr_error/tokenizer.py`,
|
|
72
|
+
`table_rec/model/encoder.py`, and `table_rec/model/encoderdecoder.py`.
|
|
73
|
+
- The copy fixes defects of its text extraction and its Markdown output,
|
|
74
|
+
drops code that raw2md never runs, and follows the formatting and lint
|
|
75
|
+
rules of raw2md (2026-10-24). Changed files, under src/raw2md_engine/:
|
|
76
|
+
- Text: `pdftext/pdf/pages.py` ignores the blank spans of a line when it
|
|
77
|
+
marks a superscript or a subscript. `marker/schema/text/line.py` keeps
|
|
78
|
+
a dash at the end of a line. `marker/schema/blocks/listitem.py` removes
|
|
79
|
+
only the leading bullet of a list item.
|
|
80
|
+
- Links: `pdftext/pdf/links.py` drops a link whose target is inside the
|
|
81
|
+
document. The page references, the reference processor and block, and
|
|
82
|
+
the span anchors go with it, in `pdftext/schema.py`,
|
|
83
|
+
`pdftext/extraction.py`, `marker/builders/document.py`,
|
|
84
|
+
`marker/providers/`, `marker/schema/`, and
|
|
85
|
+
`marker/renderers/markdown.py`.
|
|
86
|
+
- Tables: `pdftext/tables.py` measures the gap between characters along
|
|
87
|
+
the line and keeps the character boxes of a table run.
|
|
88
|
+
`marker/processors/table.py` splits a run of numbers at the cell
|
|
89
|
+
boundaries.
|
|
90
|
+
`marker/renderers/markdown.py` escapes a vertical bar in a cell and
|
|
91
|
+
writes one separator line for a table of one row.
|
|
92
|
+
- Formats and math: `marker/schema/text/span.py` applies every format of
|
|
93
|
+
a span, with math innermost and bold outermost, and keeps superscript
|
|
94
|
+
markup out of math. `marker/renderers/__init__.py` keeps the minus when
|
|
95
|
+
two inline math spans merge. `marker/renderers/markdown.py` keeps the
|
|
96
|
+
escaped space at the end of math and removes bold from a heading.
|
|
97
|
+
- Layout: `marker/processors/sectionheader.py` sorts the heading heights
|
|
98
|
+
together with their cluster labels, gives one level to neighboring
|
|
99
|
+
clusters of close mean heights, and keeps headers without lines out of
|
|
100
|
+
the clusters. `marker/processors/ignoretext.py`
|
|
101
|
+
counts the repeats of a running header on the even and the odd pages
|
|
102
|
+
apart.
|
|
103
|
+
- Dead code: `marker/converters/pdf.py` drops the line merge, blank page,
|
|
104
|
+
and block relabel processors, and their files go.
|
|
105
|
+
- Imports: `marker/settings.py` imports torch only when the device is
|
|
106
|
+
read. `surya/common/surya/processor/tokenizer.py` imports no torch and
|
|
107
|
+
builds without a special token file.
|
|
108
|
+
- Style: ruff formats every Python file of the copy and applies its safe
|
|
109
|
+
fixes. `surya/detection/heatmap.py` takes its result class from
|
|
110
|
+
`surya/detection/schema.py`, which breaks an import cycle.
|
|
111
|
+
- The Markdown renderer returns the HTML that it converts to Markdown
|
|
112
|
+
(2026-11-01). Changed file, under src/raw2md_engine/:
|
|
113
|
+
`marker/renderers/markdown.py`.
|
|
114
|
+
- The PDF converter names each of its steps to an optional phase callback
|
|
115
|
+
before the step runs (2026-11-01). Changed file, under
|
|
116
|
+
src/raw2md_engine/: `marker/converters/pdf.py`.
|
|
117
|
+
- The repeated text processor hides a copy of a running header only when
|
|
118
|
+
at least two other copies stand at its height, and its text key keeps a
|
|
119
|
+
number that follows a dot (2026-11-08). Changed file, under
|
|
120
|
+
src/raw2md_engine/: `marker/processors/ignoretext.py`.
|
|
121
|
+
- The text fixer keeps fullwidth forms and curly quotes, and repairs the
|
|
122
|
+
rest as before. Math keeps the default configuration (2026-11-11).
|
|
123
|
+
Changed files, under src/raw2md_engine/: `marker/util.py`,
|
|
124
|
+
`marker/providers/pdf.py`, `marker/builders/ocr.py`, and
|
|
125
|
+
`marker/processors/table.py`.
|
|
126
|
+
- A block that OCR reads as a whole keeps the frames of its detector lines,
|
|
127
|
+
and one block method returns the line frames of any block (2026-11-11).
|
|
128
|
+
Changed files, under src/raw2md_engine/: `marker/builders/ocr.py` and
|
|
129
|
+
`marker/schema/blocks/base.py`.
|
|
130
|
+
- A paragraph cut by a page keeps a trailing dash, and it joins without a
|
|
131
|
+
space when Han, kana, or fullwidth punctuation meet at the cut
|
|
132
|
+
(2026-11-11). Changed file, under src/raw2md_engine/:
|
|
133
|
+
`marker/renderers/markdown.py`.
|
|
134
|
+
- The text processor joins a paragraph cut by a page, a column, or a
|
|
135
|
+
figure. It steps over pictures, captions, and footnotes, reads the text
|
|
136
|
+
at the cut as well as the line frames, and moves the second half behind
|
|
137
|
+
the first, so the figure follows the joined paragraph. A hyphen `-` at
|
|
138
|
+
the cut stays before a capital or a digit, and a soft hyphen `¬` goes.
|
|
139
|
+
A text block that holds only a label and a number is no half, and a text
|
|
140
|
+
block that repeats on three pages or more is stepped over
|
|
141
|
+
(2026-11-12). Changed files, under
|
|
142
|
+
src/raw2md_engine/: `marker/processors/text.py`,
|
|
143
|
+
`marker/processors/debug.py`, and `marker/renderers/markdown.py`.
|
|
144
|
+
- The line height of a block divides the block height by the count of
|
|
145
|
+
detector line frames, so a heading that OCR reads as one text line gets
|
|
146
|
+
the height of one line (2026-11-11). Changed file, under
|
|
147
|
+
src/raw2md_engine/: `marker/schema/blocks/base.py`.
|
|
148
|
+
- The nesting of a list item needs the start of its first text line and
|
|
149
|
+
the frame of the item both to move right of the parent (2026-11-12).
|
|
150
|
+
Changed file, under src/raw2md_engine/: `marker/processors/list.py`.
|
|
151
|
+
- The equation processor keeps the text of a formula block. A reading
|
|
152
|
+
without math gives the text layer of the block, or a paragraph when the
|
|
153
|
+
block has no text layer. A reading with a word outside its formulas is
|
|
154
|
+
a line with inline math. Any other reading puts each formula on its own
|
|
155
|
+
display line and keeps the punctuation and the numbers between the
|
|
156
|
+
formulas in order. A formula enclosed by brackets or parentheses, or one
|
|
157
|
+
wrapped in square brackets, stays inline on the line under the formula
|
|
158
|
+
before it. A bracketed condition outside the formulas, with a relation
|
|
159
|
+
and no word of three letters or more, is not a word (2026-11-14).
|
|
160
|
+
Changed file, under src/raw2md_engine/: `marker/processors/equation.py`.
|
|
161
|
+
- A picture keeps the frame of the layout model, and a detector line goes
|
|
162
|
+
to a picture only when at least half of its area lies inside that frame.
|
|
163
|
+
A text line beside a chart goes to another block by overlap or by
|
|
164
|
+
distance, or to a new text block. A new block whose center equals the
|
|
165
|
+
center of an existing block no longer fails the placement
|
|
166
|
+
(2026-11-13). Changed file, under src/raw2md_engine/:
|
|
167
|
+
`marker/schema/groups/page.py`.
|
|
168
|
+
- A new processor hides a picture whose frame lies in the top or the
|
|
169
|
+
bottom 15 % of the page and repeats at one place, each edge within
|
|
170
|
+
0.015 of the page side, on three pages or more. The renderer neither
|
|
171
|
+
shows nor saves a hidden picture, and the block stays in the document
|
|
172
|
+
(2026-11-13). Added file, under src/raw2md_engine/:
|
|
173
|
+
`marker/processors/image_furniture.py`. Changed files:
|
|
174
|
+
`marker/converters/pdf.py` and `marker/renderers/html.py`.
|
|
175
|
+
- The Markdown renderer ends each paragraph without continuation without a
|
|
176
|
+
space, so a paragraph that ends in an italic span or an inline formula
|
|
177
|
+
at the foot of a page does not read as a paragraph cut by the page
|
|
178
|
+
(2026-11-13). Changed file, under src/raw2md_engine/:
|
|
179
|
+
`marker/renderers/markdown.py`.
|
|
180
|
+
- A table cell joins a line that wraps onto the next line with a space,
|
|
181
|
+
and it keeps each new value on a line of its own. A line wraps when the
|
|
182
|
+
first word of the next line would not fit into the room that the line
|
|
183
|
+
leaves in its column, and the next line starts under it, at most 0.3
|
|
184
|
+
line heights below. The width of a column is its widest line, each line
|
|
185
|
+
counted at most at the width of its cell. A line that opens with a
|
|
186
|
+
bullet is a new value. A hyphen at the end of a wrapped line goes
|
|
187
|
+
before a lowercase letter and stays before a capital or a digit. A cell
|
|
188
|
+
without line frames keeps its lines (2026-11-14).
|
|
189
|
+
Changed file, under src/raw2md_engine/: `marker/processors/table.py`.
|
|
190
|
+
- A new processor joins a table that a page break cuts in two. The table
|
|
191
|
+
that closes a page takes the rows of the table that opens the next page,
|
|
192
|
+
when only running headers, footers and hidden blocks stand between them,
|
|
193
|
+
the column counts are equal or differ by one with each column of the
|
|
194
|
+
narrower part over a column of the wider part, and the first rows of the
|
|
195
|
+
second part repeat the first rows of the first part cell for cell or the
|
|
196
|
+
table model reads its first row as data. Past the first row, only a
|
|
197
|
+
header row repeats. The repeated rows go. A table whose first row
|
|
198
|
+
repeats a run of its own cells, records set side by side, stays apart,
|
|
199
|
+
and so does a part where a header row did not repeat or a cell spans
|
|
200
|
+
over the cut. A table cell keeps the header flag of its row from the
|
|
201
|
+
table model (2026-11-14). Added file, under src/raw2md_engine/:
|
|
202
|
+
`marker/processors/table_merge.py`. Changed files:
|
|
203
|
+
`marker/converters/pdf.py`, `marker/processors/table.py` and
|
|
204
|
+
`marker/schema/blocks/tablecell.py`.
|
|
205
|
+
- The text processor reads the first line of a second half as indented
|
|
206
|
+
when it starts right of the leftmost line by more than a tolerance. When
|
|
207
|
+
the text at the cut shows a continuation, the tolerance is 1.5 units or
|
|
208
|
+
0.02 of the block width, whichever is larger, so one step of the line
|
|
209
|
+
frames is no indent wherever the block stands on the page. Without that
|
|
210
|
+
text, an offset of more than 0.01 units is an indent (2026-11-15).
|
|
211
|
+
Changed file, under src/raw2md_engine/: `marker/processors/text.py`.
|
|
212
|
+
- The text processor joins two text blocks of one page that stand one
|
|
213
|
+
right under the other with no block between them, when the text at the
|
|
214
|
+
cut shows a continuation and the second block does not start indented.
|
|
215
|
+
The gap between the blocks is less than half the median line height of
|
|
216
|
+
the first block and not less than minus half of it. The blocks overlap
|
|
217
|
+
along the horizontal axis by at least half the width of the narrower
|
|
218
|
+
block (2026-11-15). Changed file, under src/raw2md_engine/:
|
|
219
|
+
`marker/processors/text.py`.
|
|
220
|
+
- The table merge processor also joins a table that a column break cuts
|
|
221
|
+
on one page. The table that ends a column takes the rows of the table
|
|
222
|
+
that opens the next column, when the second part starts no lower than
|
|
223
|
+
the first and right of its right edge, only running headers, footers
|
|
224
|
+
and hidden blocks stand between them, and the conditions of a page
|
|
225
|
+
break hold. Each column of one part also overlaps its column of the
|
|
226
|
+
other part, with the edges measured as a share of the width of their
|
|
227
|
+
own table (2026-11-15). Changed file, under src/raw2md_engine/:
|
|
228
|
+
`marker/processors/table_merge.py`.
|
|
229
|
+
- The table merge processor reads a first row of the second part that
|
|
230
|
+
the table model flags as a header as a data row, at a page break and at
|
|
231
|
+
a column break, when each filled cell of the row has the form of its
|
|
232
|
+
column in the data rows of the first part: a number under numbers, or
|
|
233
|
+
the code that two data rows or more of the column all hold. One cell at
|
|
234
|
+
least falls under such a column, so a row of words over columns of
|
|
235
|
+
numbers stays a header (2026-11-15). Changed file, under src/raw2md_engine/:
|
|
236
|
+
`marker/processors/table_merge.py`.
|
|
237
|
+
- The text processor counts a text block as repeated when it holds three
|
|
238
|
+
words split by spaces or eleven letters, so a running line in a script
|
|
239
|
+
without spaces between words counts as well (2026-11-17). Changed file,
|
|
240
|
+
under src/raw2md_engine/: `marker/processors/text.py`.
|
|
241
|
+
- The text processor reads text evidence in a script without letter case:
|
|
242
|
+
at a page or column break, a first half that holds 20 characters or
|
|
243
|
+
more besides spaces and ends in a letter or a comma, and a second half
|
|
244
|
+
that opens with a letter without case and no item number (2026-11-17).
|
|
245
|
+
Changed file, under src/raw2md_engine/: `marker/processors/text.py`.
|
|
246
|
+
- The lines of one block join without a space where Han, kana, or
|
|
247
|
+
fullwidth punctuation meet at the line end, by the same test as the
|
|
248
|
+
join of a paragraph cut by a page. Hangul and Latin keep the space
|
|
249
|
+
(2026-11-17). Changed files, under src/raw2md_engine/:
|
|
250
|
+
`marker/util.py`, `marker/schema/text/line.py`, and
|
|
251
|
+
`marker/renderers/markdown.py`.
|
|
252
|
+
- The table merge processor relaxes the test of a flagged first row. A
|
|
253
|
+
placeholder `-`, `/`, `*` or `_` counts as a number, a column of three
|
|
254
|
+
values or more holds numbers when 80 % of its values or more are
|
|
255
|
+
numbers, and a cell over several columns takes any form. A row that
|
|
256
|
+
fills only the first column reads as data when the first later row
|
|
257
|
+
that fills another column reads as data (2026-11-18). Changed file,
|
|
258
|
+
under src/raw2md_engine/: `marker/processors/table_merge.py`.
|
|
259
|
+
- The copy imports the text tests that raw2md shares with its cleaning
|
|
260
|
+
from the module `raw2md.mdtext.seams`, which imports no code of the
|
|
261
|
+
copy. The text processor reads the end of a sentence there: a sentence
|
|
262
|
+
mark, past closing quotes and brackets (2026-11-19). It reads there as
|
|
263
|
+
well the text evidence that the two halves of a cut paragraph carry on
|
|
264
|
+
one sentence, in a script with letter case and in one without
|
|
265
|
+
(2026-11-19). Changed file, under src/raw2md_engine/:
|
|
266
|
+
`marker/processors/text.py`.
|
|
267
|
+
- The test that two lines meet without a space, at Han, kana, and
|
|
268
|
+
fullwidth text, moves from `marker/util.py` to the same module
|
|
269
|
+
`raw2md.mdtext.seams` unchanged (2026-11-19). Changed files, under
|
|
270
|
+
src/raw2md_engine/: `marker/util.py`, `marker/schema/text/line.py`,
|
|
271
|
+
and `marker/renderers/markdown.py`.
|
|
272
|
+
- The text processor reads the label and the number that open a caption
|
|
273
|
+
from the same module `raw2md.mdtext.seams`. A label is a capitalized
|
|
274
|
+
word of up to 12 letters or a word of the config option
|
|
275
|
+
`caption_labels`, which raw2md fills from its own word list. The number
|
|
276
|
+
is arabic, with its sections, or roman (2026-11-19). Changed file,
|
|
277
|
+
under src/raw2md_engine/: `marker/processors/text.py`.
|
|
278
|
+
- The table merge processor reads the form of a number from the module
|
|
279
|
+
`raw2md.mdtext.tables`, which the cleaning reads too. A number may open
|
|
280
|
+
on a point, as in `.690`, and parentheses may enclose it, as in
|
|
281
|
+
`(12.4)` (2026-11-19). Changed file, under src/raw2md_engine/:
|
|
282
|
+
`marker/processors/table_merge.py`.
|
|
283
|
+
- A line-end hyphen that the copy used to delete becomes a soft hyphen
|
|
284
|
+
(U+00AD): at the end of a line of a block, at a hyphenated break inside
|
|
285
|
+
a span, at the cut of a paragraph that continues, and at a wrapped line
|
|
286
|
+
of a table cell. The cleaning of raw2md keeps or drops the hyphen by the
|
|
287
|
+
spellings of the text. At the end of a line of a block, the soft hyphen
|
|
288
|
+
follows a letter only, and a hyphen after a digit or a space goes as
|
|
289
|
+
before. A hyphen that the copy keeps before a capital or a digit stays
|
|
290
|
+
(2026-11-20). Changed files, under src/raw2md_engine/:
|
|
291
|
+
`marker/util.py`, `marker/schema/text/line.py`,
|
|
292
|
+
`marker/schema/text/span.py`, `marker/renderers/markdown.py`, and
|
|
293
|
+
`marker/processors/table.py`.
|
|
294
|
+
- The table processor no longer removes the dot leaders from a cell line.
|
|
295
|
+
The cleaning of raw2md removes them from each line of a pipe-table cell
|
|
296
|
+
(2026-11-20). Changed file, under src/raw2md_engine/:
|
|
297
|
+
`marker/processors/table.py`.
|
|
298
|
+
- The table processor no longer joins a column of dollar signs with its
|
|
299
|
+
neighbour. The cleaning of raw2md does it on the pipe table
|
|
300
|
+
(2026-11-20). Changed file, under src/raw2md_engine/:
|
|
301
|
+
`marker/processors/table.py`.
|
|
302
|
+
- The Markdown renderer no longer removes bold from a heading. The
|
|
303
|
+
cleaning of raw2md removes each bold run from a heading on every route
|
|
304
|
+
(2026-11-20). Changed file, under src/raw2md_engine/:
|
|
305
|
+
`marker/renderers/markdown.py`.
|
|
306
|
+
- The table processor joins the wrapped lines of each cell before it
|
|
307
|
+
splits the rows that the table model merged, so a value that wraps to a
|
|
308
|
+
second line keeps its row (2026-11-20). Changed file, under
|
|
309
|
+
src/raw2md_engine/: `marker/processors/table.py`.
|
|
310
|
+
- The copy imports no transformers module that a release of transformers 5
|
|
311
|
+
removed: the mask of fully masked rows is computed in the copy itself,
|
|
312
|
+
and the tokenizer base class comes from the top level of transformers
|
|
313
|
+
(2026-11-21). Changed files, under src/raw2md_engine/surya/:
|
|
314
|
+
`common/adetr/decoder.py`, `common/surya/__init__.py`, and
|
|
315
|
+
`common/surya/processor/__init__.py`.
|
|
316
|
+
- The OCR builder re-reads a line of the text layer on a scan page, a page
|
|
317
|
+
that one image covers by 90 % or more. The line holds `^` or U+FFFD and
|
|
318
|
+
its center lies outside a picture, a figure, a table, a form, and a table
|
|
319
|
+
of contents. The recognition model reads the line inside its frame, with
|
|
320
|
+
a token limit by the length of the line. A reading replaces the line
|
|
321
|
+
when it is not empty and holds no `^` or U+FFFD outside math, no group of
|
|
322
|
+
three characters or more five times in a row, and no empty group `{}` in
|
|
323
|
+
math. The page keeps its text layer for the other lines (2026-11-26).
|
|
324
|
+
Changed files, under src/raw2md_engine/: `marker/providers/pdf.py` and
|
|
325
|
+
`marker/builders/ocr.py`.
|
|
326
|
+
|
|
327
|
+
Each changed file of `pdftext/` carries a notice at its top.
|
|
328
|
+
|
|
329
|
+
Last change: 2026-11-26.
|