freelawproject / eyecite

Find legal citations in any block of text
https://freelawproject.github.io/eyecite/
BSD 2-Clause "Simplified" License
119 stars 29 forks source link

California parentheticals use square brackets?? #65

Open mlissner opened 3 years ago

mlissner commented 3 years ago

According to the grand daddy of parentheticals, apparently CA uses square brackets instead of parentheses:

https://twitter.com/tweetatpablo/status/1392920773824630784

I guess this means our regex needs a tweak, but it'd be nice to see this in the wild before we permanently add code based on a tweet.

And...I guess this means parentheticals should be called something else. "ParenBracketTheticals," perhaps.

devlux76 commented 2 years ago

It's part of the official California Style Manual

§1:1[F] Parallel citations Depending on the jurisdiction, an opinion may appear in multiple paper-based reporters and computer-based sources. Parallel citations are citations to alternate sources for an opinion. Parallel citations follow an official or primary citation and are always enclosed in brackets. Opinion authors are not required to provide parallel citations in opinions; parallel citations are added during editorial preparation of the opinion for Official Reports publication. In some circumstances (e.g., recently filed United States Supreme Court opinions), parallel citations will be available before the official citation (see §§ 1:3, 1:32[B]). In this situation, use the parallel citation throughout, including for point page references. (O'Connor v. Ortega (1987) 480 U.S. 709 [107 S.Ct. 1492,94 L.Ed.2d 714].) and in People v. Mayfield (1997) 14 Cal.4th 668 [60 Cal.Rptr.2d 1,928 P.2d 485], ... (Nederv. United States (1999)U.S.[119 S.Ct. 1827, 1831, 144 L.Ed.2d 35].)

In the above, Nederv is not available in the US reporter yet (1999 was too hot off the press in 2000 when this was last updated), but it is available in both the Supreme Court reporter and in the "Lawyers Edition 2nd" (Lexis?) When bumping up against that particular "feature", it might wise to do a DB lookup or something to see if it was finally reported. Unpublished cases are not citable in California

§ 1:6 Parenthetical description of case If helpful, the relationship of a cited opinion to the text discussion can be illuminated by a short parenthetical description after the citation. Use parentheses when the citation is part of the main text; use brackets if the citation is within parentheses.

Just an FYI a quick search of the document for the word "bracket" shows 82 references.

I would still term these parentheticals, but maybe if this is an issue, you narrow first then widen. Seems to me it should look for digits, alpha+punc, digits to isolate the paragraph it's in then examine the surrounds to try and find how it slots in. I dunno if there's a "this looks like it could be a citation, but I can't categorize it option" but it would be super handy if there were.

devlux76 commented 2 years ago

Looks like my block quote lost some formating, to see what I'm talking about look at the California Style Manual on page 32

mlissner commented 2 years ago

I think this ticket is really more about the parentheticals, not the neutral citations, so I think the fix here would be just to allow square brackets around parentheticals (I'm not sure how hard this is, but I suspect it's straightforward [tests would help too]).

devlux76 commented 2 years ago

I'll fork the code this evening and take a look. Honestly I've never peeked under the hood of this beast. Regex's have always looked like some sort of black magic to me, but I guess now is as good a time to learn them as ever.

True story I once wrote a regex to search for something on my hard drive and ended up summoning Cuthulu shudder

mlissner commented 2 years ago

The good part of this code base is there are a lot of tests, so when you've got something good, you'll know nothing broke. Related to Cuthulu: https://stackoverflow.com/a/1732454/64911

ss108 commented 2 years ago

Not sure if this is helpful or not, but I interned at the California CoA, and yes, they are pretty serious about the California-specific citation styles lol.

Contrast that with NY State courts, where the Appellate Division judges often use different styles from one another and, e.g., the DA's office didn't even seem to care that much about whatever the NY-specific style was lol

anseljh commented 2 weeks ago

See also https://github.com/freelawproject/eyecite/issues/185