lllin000_PaperForge/scripts/dev/caption_pattern_full.json

58 lines
1 KiB
JSON
Raw Permalink Normal View History

fix: appendix numbering cross-cutting bugs (TABLE regex, int block_id, table alpha prefix, weak-caption tie-break) 3 distinct bugs found and fixed: 1. TABLE in figure regex (_FIGURE_NUMBER_PATTERN) Removed TABLE/Table from figure regex — caused table captions to be extracted as figure numbers and roadmapped into figure inventory. Added unit tests (table_numeric_caption_is_not_a_figure_number, table_appendix_caption_marker_has_no_figure_number). 2. int block_id type mismatch in cross-page lookup CrossPageSettlementPass and PrimarySamePagePass compared block_id with === but deduped_legends use int keys while ResourceRef stores str. Fixed by casting both to str. Table continuation lookup missed page filter, picking wrong page's same block_id. Added page filter + int_block_id tests. 3. Table appendix support gaps - Table prefix regex only accepted digits/roman, not 'TABLE A1'. Added [A-Z]\d+ token and strip-leading-alpha in parse. - _is_validation_first_table_candidate didn't cover figure_title raw_label blocks with table_caption_like style. Added second gate. - _is_weak_explicit_table_caption only checked table_caption roles. Extended to include validation-first candidates. - Same-page tie-break didn't apply for weak-explicit captions. Ported _bare_table_tie_break into vnext pass. - figure_caption_candidate not excluded from note attachment. - Continuation merge stripped leading duplicate table marker. M84CTEM9 vault verification: 6/6 figures matched (3 main + 3 appendix + assets), 4/4 tables (Table 1,2 + Table A1,A2 + assets), 0 false positives, 0 figure asset leakage.
2026-07-03 17:29:06 +00:00
{
"plain_subtypes": {
"short_alpha_label": 222,
"very_short_trash": 418,
"descriptive_paragraph": 767,
"mislabeled_table": 67,
"subfigure_label": 5,
"box_or_appendix_text": 3
},
"selected_papers": {
"appendix_alpha": [
"2BFG5P6B",
"4CML4K3Y",
"7CIULR7G",
"AH6Q7DLC",
"APNGVIIY",
"BAGSWM3L",
"HXZHMT2Q",
"LCGJ6IMF",
"LJU5RQUB",
"M84CTEM9",
"NSV8KBJY",
"XTUQTWER"
],
"scheme_numeric": [
"3FQYMMXS",
"4ZCBXS4P",
"5CK2JEIS",
"6ZWKUPCU",
"7Q3VTNHT",
"7THZ5Y9G"
],
"fig_nospace": [
"5MAW65YD",
"A6IC2SIK",
"UGA8GFAR"
],
"numeric_alpha": [
"8CCATQE3"
],
"plain_majority": [
"KBLPLRVL",
"P9D6GZ9M",
"KIX7SKXQ",
"XBSC5X2H",
"VAMSAZMG",
"A6IC2SIK"
],
"standard_baseline": [
"NC66N4Q3",
"LISDYT7V",
"S9UMIF83",
"PJBMGVTF",
"Y5KQ4JQ7",
"4IG7M4FI"
]
}
}