Skip to content

docs: document the length chunker boundary settings - #475

Open
marevol wants to merge 5 commits into
masterfrom
feature/length-chunker-boundary-settings
Open

docs: document the length chunker boundary settings#475
marevol wants to merge 5 commits into
masterfrom
feature/length-chunker-boundary-settings

Conversation

@marevol

@marevol marevol commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents the three content_chunker.length.boundary.* settings added by the boundary-aware chunking change in fess, and the resulting change to what content_chunker.length.chunk_size means.

Added to 15.8/config/search-semantic.rst in all seven languages (en, ja, de, fr, es, ko, zh-cn), as new rows next to the existing content_chunker.length.overlap entry plus one note after the table. All seven already carried a fully parallel translation of that table, so leaving five of them untouched would have left them describing chunk_size as an exact per-chunk character count.

What is documented

key default range
content_chunker.length.boundary.enabled true --
content_chunker.length.boundary.lookback_percent 20 0-50
content_chunker.length.boundary.lookahead_percent 5 0-25

The note covers:

  • Each cut moves to the nearest suitable break within the search window, preferring a line break or sentence end over a clause separator or space, and those over a script change. Only the cut point moves, so concatenating a document's chunks still reproduces its content exactly.
  • chunk_size is now a target rather than a hard ceiling. The forward sentence search may overshoot by up to lookahead_percent; separately, and not governed by lookahead_percent, moving off a grapheme cluster may overshoot by up to 32 characters. The two never occur on the same cut, so the worst case is about 841 characters at the shipped defaults.
  • Chunks can be up to lookback_percent shorter, so a document may produce slightly more chunks -- relevant to content_chunker.max_chunks_per_document.
  • boundary.enabled=false, or both percentages at 0, restores the previous fixed-length behaviour.

The chunk_size row now points at that note, so a reader scanning the table does not miss the target-versus-ceiling caveat.

Notes for review

The tier precedence and every figure were checked against the implementation, and the numbers are identical across all seven languages. Each file parses with docutils with exactly the same message set as before the change.

The non-English text was not reviewed by a native speaker; corrections welcome, particularly for the de, fr, es and ko notes.

marevol added 5 commits August 9, 2026 16:57
Add content_chunker.length.boundary.enabled / lookback_percent /
lookahead_percent to the system.properties reference table in
config/search-semantic.rst, next to the existing
content_chunker.length.overlap entry, across all 7 languages
(en, ja, de, fr, es, ko, zh-cn).

Also add a note explaining that content_chunker.length.chunk_size is
now a target rather than a hard ceiling: the boundary search can
overshoot it by up to lookahead_percent, a separate grapheme-cluster
overshoot of up to 32 characters can occur independently of that
setting, and chunks can come in up to lookback_percent shorter
(affecting content_chunker.max_chunks_per_document). Setting
boundary.enabled=false, or both percentages to 0, restores the
previous exact fixed-length behavior.
Address 11 review findings on the search-semantic.rst boundary-settings
addition, across all 7 languages (en, ja, de, fr, es, ko, zh-cn):

- Add the missing "space" break kind to the boundary.enabled row and
  note, matching fess_config.properties' five-way enumeration (line
  break, sentence end, comma, space, script change).
- en: escape the lookback/lookahead range annotations with `\ ` so
  they render without a space, matching the other 6 languages and en's
  own neighboring `-1``\ (unlimited)`` row.
- ja: fix "近い" -> "最も近い" (approximately near -> nearest) so the
  note doesn't understate how precisely the cut is aligned.
- ja: replace the invented terms "カット"/"切断位置" with "分割位置",
  matching the terminology already used throughout the page.
- zh-cn: fix the note's direction word (向前搜索 -> 向后搜索) so it
  matches the table's own lookahead-vs-lookback convention.
- es/fr: localize "joiner"/"joigneur" as "ensamblador de ancho cero
  (ZWJ)" / "jointeur de largeur nulle (ZWJ)".
- fr: "tomberait sinon" -> "tomberait autrement"; "de jusqu'à" -> "d'au
  plus" (both occurrences).
- de: rework "Satzwechsel"/"Teilsatzwechsel" into the grammatically
  correct "Satz-, Teilsatz- oder Zeilengrenze ... Schriftsystemwechsel".
- ko: "경계를 얼마나 찾을 수 있는지" -> "얼마나 멀리까지 경계를 탐색할
  수 있는지" (searches for how much boundary -> how far the search may
  look).
- Add a short "(target, see note below)" pointer to the pre-existing
  chunk_size row in all 7 languages, since the target-vs-ceiling
  caveat lives in a note ~70 lines below the row.

Verified: docutils parses all 7 files with the identical error/warning
set (line-number-normalized) before and after; all touched lines stay
within each file's pre-existing max line length; defaults/ranges/figures
(true, 20 (0-50), 5 (0-25), 32, 841) are unchanged and consistent across
languages.
Address 4 review findings on the search-semantic.rst boundary-settings
addition, across all 7 languages (en, ja, de, fr, es, ko, zh-cn):

- Replace the "moves to the nearest break" claim (row + note, all 7
  languages) with the tiered behaviour ChunkBoundaryFinder actually
  implements: it prefers a line break or sentence end (STRONG) over a
  clause separator or space (WEAK), and those over a script change
  (SCRIPT), within the lookback/lookahead search window -- not simply
  the nearest candidate of any kind. A sentence end further back can
  beat a closer space, so a chunk can end noticeably earlier than
  chunk_size to land on a sentence boundary.
- de: reflow the note paragraph that a previous fix left with a
  40-column orphan line ("Die Vorwaertssuche kann ``chunk_size``")
  not forced by any long literal.
- zh-cn: fix a break that separated the measure word from its noun
  (一篇 / 文档 across a line break); also reflow a similarly
  unforced short line the same fix introduced.
- es: drop the article on "un espacio" (was the only articled item in
  an otherwise bare-noun list) and replace "ensamblador" (reads as a
  computing "assembler") with "conector de ancho cero"; fix the
  resulting nested "))" from the ZWJ gloss in both es and fr.
- ko: drop the redundant 참고/참조 pairing on the chunk_size row's
  target-value pointer.

Verified: docutils parses all 7 files with a message set identical
(line-number-normalized) to both the pre-task-8 baseline and the prior
fix rounds; defaults/ranges/figures (true, 20 (0-50), 5 (0-25), 32, 841)
unchanged and consistent across languages; every touched line stays
within its file's pre-existing maximum width.
Change of method for this round: every paragraph touched by the
length-chunker boundary-settings addition (the boundary.enabled table
cell and its note, across all 7 languages) was rewrapped from scratch
using an East-Asian-Width-aware greedy-fill algorithm, instead of
hand-patching individual lines. For ja/zh-cn the source text was
pre-segmented into non-breakable phrase units (compounds, and each
noun with its bound particle/classifier fused together) so the
wrapper can only place a line break after a particle or after
punctuation, never inside a word or between a classifier and its
noun.

Wrapping defects cleared (all introduced by the previous round's
line-patching):
- es: removed a 40-column orphan ("puede superar ``chunk_size`` en
  hasta") in an otherwise 89-95-column paragraph.
- zh-cn: removed a 25-column orphan ("此外还可能出现第二种、") and a
  split of 搜索窗口 across a line break (rendered as "搜索 窗口内").
- ja: removed a split of 検索ウィンドウ across a line break, and a
  split that orphaned the particle を from それら.

Content/terminology fixes:
- de: restored the broader "clause separator" term (Teilsatztrenn-
  zeichen) in place of "ein Komma", since isClauseSeparator covers
  more than commas (; : - 、 , ; : 、 ・ ・ ‐ ‑ – — ― 〜 ~ among
  others); removed a newly-introduced second colon in the same
  sentence.
- es: made the boundary.enabled row/note use "límite" instead of
  "ruptura" for the break, matching the pre-existing, untouched
  lookback_percent/lookahead_percent rows that already say "límite".
- ko: replaced 검색 창 (reads as a search-box UI widget) with 탐색
  terminology, matching how the rest of the file already refers to
  this search (경계를 탐색할 수 있는지, 전방 탐색).
- en/de/fr/es/ko/zh-cn/ja: separated the no-character-loss guarantee
  from the tier-preference clause it was previously (incorrectly)
  presented as a consequence of; it now follows from the boundary
  being moved rather than the text being discarded, stated as its own
  sentence.

Verified: docutils message set identical (line-number-normalized) to
the pre-task-8 baseline for all 7 files; every compound/classifier+
particle term checked programmatically as never split across a line
boundary anywhere in the ja/zh-cn files; numbers/ranges/figures
unchanged and consistent across languages; every line's East-Asian-
Width-aware display width measured and confirmed within each file's
pre-existing maximum (123 columns, shared JSON code block, identical
in all 7 languages).
Two single-line fixes, no rewrapping or wording changes beyond these:

- de: "Verschoben wird dabei nur die Schnittstelle selbst" ->
  "... der Schnittpunkt selbst". Schnittstelle means "interface"
  (API), not "cut point" -- inconsistent with this file's own
  Schnittpunkt/Schnitt usage and with every other language's "cut
  point" wording.
- ja: moved the line break from after the full-width opening bracket
  "(" to before it, so the source no longer ends a line on a bare
  opening bracket (a hard line-break there survives into the
  rendered <p> and the browser collapses it to a visible space just
  inside the bracket -- also a 行末禁則 violation). Matches the
  file's own convention of keeping "(" attached to what follows
  (e.g. "(``m=16``" a few lines below).

Verified: docutils message set identical to the 02c5b80~1 baseline
in all 7 languages; EAW max still 123 in all 7 files, at or below
each file's pre-existing baseline; true/32/841 all still present in
every language; diff confirms only these two lines changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant