Restructure: Move 47 cv_* files into ocr/ package
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 39s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m34s
CI / test-python-agent-core (push) Successful in 20s
CI / test-nodejs-website (push) Successful in 26s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-25 21:03:54 +02:00
parent 45287b3541
commit cb1be59e46
95 changed files with 317 additions and 103 deletions

View File

@@ -0,0 +1,2 @@
"""Cell-grid construction sub-package."""
from .cell_grid import * # noqa: F401,F403

View File

@@ -10,8 +10,8 @@ from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from cv_vocab_types import PageRegion, RowGeometry
from cv_ocr_engines import (
from ..types import PageRegion, RowGeometry
from ..engines.engines import (
RAPIDOCR_AVAILABLE,
_assign_row_words_to_columns,
_clean_cell_text,
@@ -22,7 +22,7 @@ from cv_ocr_engines import (
ocr_region_rapid,
ocr_region_trocr,
)
from cv_cell_grid_helpers import (
from .helpers import (
_MIN_WORD_CONF,
_ensure_minimum_crop_size,
_heal_row_gaps,

View File

@@ -16,7 +16,7 @@ DATENSCHUTZ: Alle Verarbeitung erfolgt lokal.
"""
# --- Helpers ---
from cv_cell_grid_helpers import ( # noqa: F401
from .helpers import ( # noqa: F401
_MIN_WORD_CONF,
_compute_cell_padding,
_ensure_minimum_crop_size,
@@ -26,26 +26,26 @@ from cv_cell_grid_helpers import ( # noqa: F401
)
# --- v2 build (current default) ---
from cv_cell_grid_build import ( # noqa: F401
from .build import ( # noqa: F401
_NARROW_COL_THRESHOLD_PCT,
_ocr_cell_crop,
build_cell_grid_v2,
)
# --- Legacy build (DEPRECATED) ---
from cv_cell_grid_legacy import ( # noqa: F401
from .legacy import ( # noqa: F401
_ocr_single_cell,
build_cell_grid,
)
# --- Streaming variants ---
from cv_cell_grid_streaming import ( # noqa: F401
from .streaming import ( # noqa: F401
build_cell_grid_streaming,
build_cell_grid_v2_streaming,
)
# --- Row merging ---
from cv_cell_grid_merge import ( # noqa: F401
from .merge import ( # noqa: F401
_PHONETIC_ONLY_RE,
_is_phonetic_only_text,
_merge_continuation_rows,
@@ -54,7 +54,7 @@ from cv_cell_grid_merge import ( # noqa: F401
)
# --- Vocab extraction ---
from cv_cell_grid_vocab import ( # noqa: F401
from .vocab import ( # noqa: F401
_cells_to_vocab_entries,
build_word_grid,
)

View File

@@ -13,7 +13,7 @@ from typing import List
import numpy as np
from cv_vocab_types import RowGeometry
from ..types import RowGeometry
logger = logging.getLogger(__name__)

View File

@@ -12,8 +12,8 @@ from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from cv_vocab_types import PageRegion, RowGeometry
from cv_ocr_engines import (
from ..types import PageRegion, RowGeometry
from ..engines.engines import (
RAPIDOCR_AVAILABLE,
_assign_row_words_to_columns,
_clean_cell_text,
@@ -22,7 +22,7 @@ from cv_ocr_engines import (
ocr_region_rapid,
ocr_region_trocr,
)
from cv_cell_grid_helpers import (
from .helpers import (
_MIN_WORD_CONF,
_compute_cell_padding,
_ensure_minimum_crop_size,

View File

@@ -11,7 +11,7 @@ import logging
import re
from typing import Any, Dict, List
from cv_ocr_engines import _RE_ALPHA
from ..engines.engines import _RE_ALPHA
logger = logging.getLogger(__name__)

View File

@@ -13,17 +13,17 @@ from typing import Any, Dict, Generator, List, Optional, Tuple
import numpy as np
from cv_vocab_types import PageRegion, RowGeometry
from cv_ocr_engines import (
from ..types import PageRegion, RowGeometry
from ..engines.engines import (
RAPIDOCR_AVAILABLE,
_assign_row_words_to_columns,
)
from cv_cell_grid_helpers import (
from .helpers import (
_heal_row_gaps,
_is_artifact_row,
)
from cv_cell_grid_build import _ocr_cell_crop
from cv_cell_grid_legacy import _ocr_single_cell
from .build import _ocr_cell_crop
from .legacy import _ocr_single_cell
logger = logging.getLogger(__name__)

View File

@@ -10,13 +10,13 @@ DATENSCHUTZ: Alle Verarbeitung erfolgt lokal.
import logging
from typing import Any, Dict, List
from cv_ocr_engines import (
from ..engines.engines import (
_attach_example_sentences,
_fix_phonetic_brackets,
_split_comma_entries,
)
from cv_cell_grid_legacy import build_cell_grid
from cv_cell_grid_merge import (
from .legacy import build_cell_grid
from .merge import (
_merge_continuation_rows,
_merge_phonetic_continuation_rows,
_merge_wrapped_rows,