Skip to content

fix: max-sentence-length cuts a flattened table at a header row of unit cells - #2999

Open
isamu wants to merge 1 commit into
mainfrom
fix/max-sentence-length-unit-header-row
Open

isamu wants to merge 1 commit into
mainfrom
fix/max-sentence-length-unit-header-row

Conversation

@isamu

@isamu isamu commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

A one-row table that a converter flattened into a sentence (the 関係会社の状況 table of a securities report: header cells, then a single company's row, then the note) has too few rows to show glued numbers, glued dates or bracketed figure cells, so max-sentence-length measured it as one long sentence. Its header row still shows what it is: two or more header cells closed by a unit in brackets and run straight into the next cell (資本金(千円)主要な事業の内容…割合(%)関係内容). Such a sentence is now measured cell by cell (unitHeaderParts in sentence-parts.ts, used only by max-sentence-length's partsOf), and a long note after the table is still reported.

A unit named in prose before a particle or a comma (金額(千円)は、比率(%)、) is not a header cell and is left alone. Rule YAML (ja and en) describes the new table shape.

Items to Confirm / Review

  • The unit list is the one isFlattenedTable already uses for header cells; the new part is only the lookahead that the next character opens another cell (kanji, katakana or a bracket). Over the Japanese corpus, every sentence holding two such unit headers was a flattened table.
  • isFlattenedTable (shared by other rules) is not changed; only max-sentence-length reads the new shape.
  • Judged corpus (Japanese documents): the false positive is gone, no correct finding lost, no new finding; some unjudged max-sentence-length findings on other flattened tables also go. yarn corpus and yarn planted unchanged.
  • The same issue's max-kanji-continuous entry is not addressed here (see the issue comment from the lead's report).

Refs #1334

🤖 Generated with Claude Code
work in lab

…it cells

A table a converter flattened with one row has too few rows to show glued numbers or dates,
but its header row does: two or more header cells closed by a unit in brackets and run into
the next cell (資本金(千円)主要な事業の内容, 割合(%)関係内容). Such a sentence is measured
cell by cell; a unit named before a particle or a comma is left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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