Skip to content

fix: handle double section symbol (§§) in statute citations#59

Closed
medelman17 wants to merge 1 commit intomainfrom
claude/issue-43-20260206-0711
Closed

fix: handle double section symbol (§§) in statute citations#59
medelman17 wants to merge 1 commit intomainfrom
claude/issue-43-20260206-0711

Conversation

@medelman17
Copy link
Copy Markdown
Owner

Summary

Fixes #43 by updating the statute extractor regex to handle double section symbols (§§).

Changes

  • Updated regex in src/extract/extractStatute.ts from §\s* to §+\s*
  • Added unit test for double section symbol token parsing
  • Added integration test via full pipeline

The tokenizer already matched §§ correctly with its §+ pattern, but the extractor regex only expected a single §. This simple fix aligns them and allows parsing citations like 42 U.S.C. §§ 1983.

Test Plan

  • Run pnpm test to verify new tests pass
  • Run pnpm typecheck to verify no type errors
  • Run pnpm lint to verify code style
  • Verify extractCitations('42 U.S.C. §§ 1983') no longer throws

Generated with Claude Code

Update extractStatute regex to match §+ (one or more section symbols)
instead of just a single §. This allows parsing of citations like
"42 U.S.C. §§ 1983" which use the plural form in legal writing.

- Updated regex pattern in src/extract/extractStatute.ts
- Added unit test for §§ token parsing
- Added integration test via full pipeline

Fixes #43

Co-authored-by: Michael Edelman <medelman17@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.37%. Comparing base (0126a97) to head (2abdc95).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #59   +/-   ##
=======================================
  Coverage   97.37%   97.37%           
=======================================
  Files          26       26           
  Lines         916      916           
  Branches      251      251           
=======================================
  Hits          892      892           
  Misses         24       24           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@medelman17
Copy link
Copy Markdown
Owner Author

Closing — §§ support already shipped in PR #67 (federal statute rewrite). The enhanced USC/CFR patterns handle double section symbols.

@medelman17 medelman17 closed this Mar 13, 2026
@medelman17 medelman17 deleted the claude/issue-43-20260206-0711 branch March 13, 2026 20:32
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.

BUG: §§ (double section symbol) crashes extractStatute

1 participant