Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(find.py): Correct span calculation for short-form citations #205

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

flooie
Copy link
Contributor

@flooie flooie commented Feb 6, 2025

Short-form citations were incorrectly identifying the span and full span of a citation.

For example:

And Twombly, 550 U. S., at 555 …

Currently, when an antecedent guess is identified, it is not factored into the full span calculation. Additionally, the pin-cite is not correctly incorporated into the offset. This fix ensures both are properly accounted for.

This PR is meant to help address an issue discovered in identifying reference citations. The issue here is that
short case citations routinely develop an issue resolving the antecedent guess as a reference citation.

Short-form citations were incorrectly identifying the span and full span of a citation.

For example:

	And Twombly, 550 U. S., at 555 …

Currently, when an antecedent guess is identified, it is not factored into the full span calculation. Additionally, the pin-cite is not correctly incorporated into the offset. This fix ensures both are properly accounted for.
@flooie flooie assigned grossir and unassigned flooie and grossir Feb 6, 2025
Copy link
Contributor

@grossir grossir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the "span_end" is not correct? Check output 17

text = "blah blah blah Adarand, 515 U.S., at 241 qdqwd lorem ipsum"

short = get_citations(text)[0]

In [15]: short
Out[15]: ShortCaseCitation('515 U.S., at 241', groups={'volume': '515', 'reporter': 'U.S.', 'page': '241'}, metadata=ShortCaseCitation.Metadata(parenthetical=None, pin_cite=None, year=None, court='scotus', antecedent_guess='Adarand'))

In [16]: text[short.full_span()[0]:short.full_span()[1]]
Out[16]: 'Adarand, 515 U.S., at 241'


# this last one is not working properly
In [17]: text[short.span()[0]:short.span()[1]]
Out[17]: '515 U.S., at '

@grossir grossir assigned flooie and unassigned grossir Feb 6, 2025
@flooie
Copy link
Contributor Author

flooie commented Feb 6, 2025

@grossir that is the current functionality I believe. I didnt want to change that in this PR b

@flooie flooie assigned grossir and unassigned flooie Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 7, 2025

The Eyecite Report 👁️

Gains and Losses

There were 0 gains and 0 losses.

Click here to see details.
id Gain Loss

Time Chart

image

Generated Files

Branch 1 Output
Branch 2 Output
Full Output CSV

@flooie flooie merged commit 42dd315 into main Feb 7, 2025
13 checks passed
@flooie flooie deleted the update-short-case-full-span branch February 7, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants