发布

  • feat: add option for table chunking (#4354)

    frostbyte_neo 发布于 2026-05-22 23:01:24 +00:00

    Summary

    Adds isolate_tables (default True) to chunk_elements and
    chunk_by_title, making the PR #4307 table-isolation behavior optional.

    • True (default): preserves current behavior — Table/TableChunk
      elements are always staged alone and never combined with neighbors by
      PreChunkCombiner.
    • False: restores the pre-#4307 behavior — tables can share pre-chunks
      with adjacent text and be combined into a CompositeElement.

    Rejects skip_table_chunking=True + isolate_tables=False with a
    ValueError, since the pass-through path only fires when a table is
    alone in its pre-chunk.


    Summary by cubic

    Adds isolate_tables to chunk_elements and chunk_by_title to toggle
    table isolation; default True preserves current behavior, while
    False lets tables share pre-chunks and merge with adjacent text into
    CompositeElements. Validation now uses bool-coerced options and raises
    ValueError when skip_table_chunking=True with isolate_tables=False
    (including falsy values like 0) for predictable behavior.

    Written for commit 1da0506ebee07437b97ef6abc5da7592dc82fdd3.
    Summary will update on new commits. Review
    in cubic


    Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com

    下载附件