-
-
Notifications
You must be signed in to change notification settings - Fork 153
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(parentheticals): Fix three bugs in parenthetical functionality #1919
Conversation
f3a5d5b
to
6f4f266
Compare
…arallel citations
6f4f266
to
14d5d72
Compare
I'm skeptical eyecite has a bug here, but I'll take a look. My guess is this has to do with the different kinds of short citations that eyecite can identify. |
I can confirm that the behavior concerned here is caused by every reporter in a parallel citation being matched as a separate citation (see the eyecite issue linked above for a minimum reproducible example). That may not necessarily a bad thing, but here it leads to citations being double- or triple-counted for purposes of the |
5e6ae31
to
cb63fb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything here looks good, but see my comment re eyecite, please. Thank you!
# Currently, eyecite has a bug where parallel citations are | ||
# detected individually. We avoid creating duplicate parentheticals | ||
# because of that by keeping track of what we've seen so far. | ||
parenthetical_texts = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty good fix. I'd prefer if we could fix it upstream though in eyecite
, and then fix it properly here, rather than hack around it. That'd make our code better, and would provide a nice enhancement to eyecite users to. See: freelawproject/eyecite#76
Merging this in conjunction with a pinky swear from @ProbablyFaiz that once eyecite is fixed, he'll return here and clean up the workaround. Very well. :) |
Bug 1: Parentheticals are stored n times in the database for n parallel citations that appear in the citation the parenthetical does. (See also freelawproject/eyecite#111)
Fixed in 14d5d72
Bug 2: We show the following explainer text on the summaries page even when there are zero summaries:
Fixed in cb63fb4
Bug 3: Using a compiled regex in an f-string does not quite work properly and was causing some incorrect computations of scores for
holding that
-style parentheticals..pattern
has the expected behavior.Fixed in 885b630
Lastly, the parenthetical filtering is tightened up to handle more edge cases.