Repository navigation
功能:增加跨页表格合并检测诊断 - #50
Closed
kernelvale wants to merge 1 commit into
Closed
kernelvale wants to merge 1 commit into
kernelvale wants to merge 1 commit into
Conversation
Owner
|
感谢提交这个 PR。 目前没有将具体检测原因提升为上层回调的计划。现有 bool 判定已经足够表达续表关系是否成立;内容能否安全拼接,继续由渲染阶段负责。因此,这里不增加公开的诊断类型和回调接口。 另外,main 已在 6e7fed37 中统一了续表前驱约定,并分离关系判定与已确认关系的内容拼接,修正了前驱选择不一致、重复进行身份检查所导致的合并歧义和多页断链问题。 因此,这个 PR 按当前设计关闭。 |
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.
动机
跨页表格检测目前通过布尔返回值和提前返回跳过候选。调用方如果不阅读实现,就无法判断表格未合并是由页边界阻断、缺少续表标题、宽度不兼容、脚注冲突还是表格结构不符造成的。
修改内容
TableMergeRejection和不可变的TableMergeDecision,提供不包含论文正文的结构化诊断。merge_table()新增可选的on_decision回调,报告页码、可用的表格块索引、拒绝原因和边界阻断信息。can_merge_tables()继续作为同一组有序检查的布尔封装;未传回调时,默认行为保持不变。兼容性影响(可选)
无。回调为可选项,默认检测和标记行为不变,不增加序列化诊断字段,也不修改文档协议。
使用场景(可选)
集成方可以在不记录表格正文的情况下,向用户解释续表被拒绝的原因,或统计文档语料中的检测情况。回调同时提供成功决策和被拒绝的页面对。
检查清单
提交前:
docs/JSON_PROTOCOL.md中说明回调约定和仅覆盖检测的范围。验证结果:
continuation_caption_required、incompatible_table_widths和boundary_blocked三种明确诊断。提交后: