Repository navigation
A lead-in ending in a full-width colon stays with its table at any length - #1282
Merged
WaylandYang merged 2 commits intoOct 16, 2026
Conversation
…ngth Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Oct 16, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you. Over 200 bytes, a Chinese lead-in can only be recognised by its colon, so accepting : alongside : fixes the case where ……如下: was split from its table, and it matches what table.rs already accepts. You're right that a lead-in can now be repeated into pieces that go over budget; English already does this. A token cap that applies to both colons deserves its own issue if you'd like to open one. Merging.
Maya-Kid
deleted the
fix/caption-with-full-width-colon-stays-with-table
branch
October 16, 2026 23:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The chunker keeps a paragraph with the table below it when the paragraph is at most 200 bytes or ends in a colon, but it checked only
:, so a long Chinese lead-in ending in:was split from its table.Problem
200 bytes is about 66 Chinese characters, so a longer lead-in is recognised only by its colon. On dev 15fd7d5,
chunk_texton this input (first line 81 characters, 243 bytes):returns four chunks: the sentence alone, then three that start at
| 项目 | 本期 |. Chunks are extracted separately, so no table chunk says what the numbers are. The same sentence ending in:opens every chunk.Change
caption_likeinchunker.rsaccepts either colon, astable.rsalready does.Like
:,:now carries a paragraph of any length: a long analysis paragraph ending in……如下:repeats in every table chunk. At the 300-token budget, a 271-character paragraph above 60 rows goes from 4 chunks to 15; a 399-character one above 20 rows, from 3 chunks to 20 one-row chunks of 381 tokens, over budget. English paragraphs ending in:already do this. A token cap for both colons could be a follow-up.Verification
a_caption_ending_in_a_full_width_colon_stays_with_its_table_at_any_lengthasserts that every chunk of the input above starts with the sentence and the header row. On dev 15fd7d5 with only this test added, it fails at chunk 0, the sentence alone.Linux x86_64 container, PostgreSQL 16 + pgvector 0.8.6, Poppler 25.03, DB required (
UTOPIA_TEST_REQUIRE_DB=1), commit 9fb292d on dev 15fd7d5: fmt and clippy clean on Rust 1.98.1 and on 1.99.1, the stable toolchain CI installs;cargo test --locked --workspace(1.98.1) 1,564 passed, 0 failed, 6 ignored.