fix(regex): keep the court group inside its own parenthetical - #347
Open
arthrod wants to merge 1 commit into
Open
fix(regex): keep the court group inside its own parenthetical#347arthrod wants to merge 1 commit into
arthrod wants to merge 1 commit into
Conversation
POST_FULL_CITATION_REGEX's court group used a lazy .*? that crawled past a citation's own (year) paren into a later (court year) paren, so year, court and full_span were taken from a neighbour. Restrict the group to [^()]*?.
|
|
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 court/year/
full_spanmis-association on string cites and on citations followed by another citation in the next sentence.Summary
POST_FULL_CITATION_REGEXcaptured the court as(?P<court>.*?)followed by a lookahead for whitespace plus a month or year. When a citation's own year paren is(2007)there is no whitespace before the digits, so the lazy court group crawled forward across2007). Later text (2d Cir.until it found1997.Fix:
(?P<court>[^()]*?). AddsFindTest.test_court_year_paren_does_not_run_oncovering four string-cite variants. Eyecite suite stays green (56 tests).Defining input:
AI Disclosure