fix: extract USC citations when the section mark is omitted - #342
Open
aseem-ai wants to merge 1 commit into
Open
fix: extract USC citations when the section mark is omitted#342aseem-ai wants to merge 1 commit into
aseem-ai wants to merge 1 commit into
Conversation
Executive-branch and Federal Register drafting writes "50 U.S.C. 1701" without the section mark, and those cites extracted as nothing. A title and a section number are still both required, so bare mentions of the code do not match.
Member
|
@claude review |
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.
Fixes
Fixes #300
Summary
Federal Register and executive-order drafting omits the section mark, so
50 U.S.C. 1701extracted as nothing while50 U.S.C. § 1701worked.This makes the marker optional in the existing law citation pattern rather
than adding a normalizing pre-pass. The pattern comes from reporters-db via
the
$section_markervariable, and that variable is used by exactly one ofthe 373 law regexes there — the U.S.C. one — so widening it at eyecite's
existing variable-override chokepoint touches only U.S.C. and needs no
hardcoded reporter name. A title and a section number are both still
required, so bare prose mentions of the code do not match. No lookahead is
introduced, so
HyperscanTokenizerstill compiles it.Lettered sections like
§ 2339Bare unchanged and still unmatched; that is#146 / #331.
Tests
python -m unittest discover -s tests -p 'test_*.py'→ 56 tests, OK.New test
test_find_usc_citations_without_section_markfails on main(
[] != [FullLawCitation]) and passes here. It covers the no-§ form, the§ form still matching once and not twice,
et seq., the sentence from theissue, and four prose negatives (
the U.S.C. is a code,U.S.C. Title 18,see U.S.C.,codified at 50 U.S.C.).Also checked by hand: extraction over
tests/assets/opinion.txtreturns thesame 170 citations before and after.
AI Disclosure