Skip to content

fix: drop footnote marks raised after acronyms inside captions - #96

Merged
917Dhj merged 1 commit into
developfrom
fix/caption-inline-footnote-marks
Nov 8, 2026
Merged

917Dhj merged 1 commit into
developfrom
fix/caption-inline-footnote-marks

Conversation

@917Dhj

@917Dhj 917Dhj commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Summary

Table captions often mark the abbreviations they use with a raised letter that points to a note below the table. jmir-chatmind-rct Table 2 reads "anxiety (GAD-7ᵃ), depression (ODSISᵇ), (PHQ-9ᶜ), and mental well-being (WHO-5ᵈ)". #89 dropped only marks after a caption's last sentence, so the extracted caption kept these as "GAD-7a", "ODSISb", and so on, which reads like different scale names.

spans_text in pdf_captions.py now also leaves out a superscript span when both of these hold:

  • its text is lowercase letters, either a single letter or a comma-separated run such as a,b;
  • it follows a token with two or more capital letters, such as GAD-7, ODSIS, or WHO-5.

These stay caption text:

  • raised variables, such as the l in "h" + "l";
  • a raised letter after a single capital, such as W + q;
  • raised digits, such as LAI + 2 or cm + 2.

Evidence

  • test_caption_extraction.py gains a parametrized test:
    • two acronym cases, which failed before this change;
    • three guard cases (hl, Wq, LAI2), which must stay unchanged.
  • Corpus diff: all captions from the 34 corpus papers (454 captions) were dumped before and after the change. Only one changed, jmir-chatmind-rct p8 Table 2:
    • before: ... anxiety (GAD-7a), depression (ODSISb), (PHQ-9c), and mental well-being (WHO-5d) scores across study groups.
    • after: ... anxiety (GAD-7), depression (ODSIS), (PHQ-9), and mental well-being (WHO-5) scores across study groups.
  • python3 -m pytest -q -n auto: 1739 passed, 1 skipped.
  • python3 -m pytest -q -m corpus: 368 passed, 21 xfailed (unchanged).
  • python3 -m ruff check skills tests: clean.

Merge Danger

  • Low. The only behavior change is in caption text, and on the corpus it touches one caption.
  • A caption that raises a lowercase variable directly after an all-caps name, such as QK with a raised t, would lose that letter. No corpus caption does this.

🤖 Generated with Claude Code

A table caption can mark the abbreviations it uses, as in jmir-chatmind-rct
Table 2: "anxiety (GAD-7a), depression (ODSISb)", where each raised letter
points to a note below the table. #89 dropped only marks after a caption's
last sentence, so these stayed in the caption as "GAD-7a".

A superscript span of lowercase letters ("a" or "a,b") is now left out when
it follows a token with two or more capitals. Raised variables such as the
"l" of "h" + "l", a single capital such as "W" + "q", and raised digits stay.

On all 34 corpus papers (454 captions), only that caption changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@917Dhj
917Dhj merged commit 45f7078 into develop Nov 8, 2026
3 checks passed
@917Dhj
917Dhj deleted the fix/caption-inline-footnote-marks branch November 8, 2026 14:59
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