"""Fuse docling's spine with the Set-of-Mark/Camelot tables.

docling and SoM/Camelot extract the same page and are each stronger at different
things, so this package fuses them — each enriches the other. SoM/Camelot owns
the vetted, text-grounded table bodies; docling owns the spine (reading order,
headings, text), an independent table count, picture classification, and the OCR
signal for regions read from the page image.

`match_tables` pairs the two extractions by bounding-box overlap and classifies
each region (see `models.RegionMatch`). The graft and annotation passes act on
those records to produce the two corrected outputs: the SoM/Camelot tables and a
unified `DoclingDocument` whose table bodies come from Camelot.

`fuse_artifacts` is the standalone fusion step (already-produced data in, both
outputs out); `DocumentFusion` is the local control flow that runs the document
and table extractions in-process and then fuses them.
"""

from quber.core.fusion.fusion import DocumentFusion, fuse_artifacts
from quber.core.fusion.graft import build_unified_document, markdown_to_table_data
from quber.core.fusion.matching import MATCH_FRACTION, match_tables
from quber.core.fusion.models import FusionResult, MatchKind, RegionMatch

__all__ = [
    "MATCH_FRACTION",
    "DocumentFusion",
    "FusionResult",
    "MatchKind",
    "RegionMatch",
    "build_unified_document",
    "fuse_artifacts",
    "markdown_to_table_data",
    "match_tables",
]
