Description
Full case citations return year: undefined and court: undefined (or "N/A") even when the year and court are clearly present in a trailing parenthetical. The extraction captures volume, reporter, and page correctly but doesn't parse the (Court Year) parenthetical that follows.
Reproduction
import { extractCitations } from 'eyecite-ts'
const text = 'See Texas v. Johnson, 491 U.S. 397, 404 (1989).'
const citations = extractCitations(text)
console.log(citations[0])
// {
// type: 'case',
// volume: 491,
// reporter: 'U.S.',
// page: 397,
// year: undefined, // Expected: 1989
// court: undefined, // Expected: 'scotus' (inferred from U.S. Reports)
// }
Additional failing examples from SCOTUS text:
| Input |
Expected Year |
Actual Year |
Expected Court |
Actual Court |
491 U.S. 397, 404 (1989) |
1989 |
undefined |
scotus |
undefined |
418 U.S. 405, 409 (1974) |
1974 |
undefined |
scotus |
undefined |
468 U.S. 288, 294 (1984) |
1984 |
undefined |
scotus |
undefined |
391 U.S. 367, 376 (1968) |
1968 |
undefined |
scotus |
undefined |
Context
The Python eyecite library extracts year and court from the trailing parenthetical as core metadata on FullCaseCitation objects. This is critical for:
- Disambiguation — when the same volume/reporter/page appears in multiple series, the year helps identify the correct case
-
- Temporal analysis — citation network analysis depends on knowing when cited cases were decided
-
- Reporter validation — the year can be cross-referenced against reporter date ranges to validate citation accuracy
-
- Court hierarchy — knowing the citing court matters for precedential weight analysis
Related Issues
Expected Behavior
The parenthetical following a case citation should be parsed for:
- Year: 4-digit number, typically at the end:
(1989), (9th Cir. 2020)
-
- Court: Court abbreviation before the year:
(9th Cir. 2020), (D. Mass. 2019), (S.D.N.Y. 2021)
-
-
- For Supreme Court reporters (
U.S., S. Ct., L. Ed.), court should be inferred as scotus even when not explicitly stated in the parenthetical
Description
Full case citations return
year: undefinedandcourt: undefined(or"N/A") even when the year and court are clearly present in a trailing parenthetical. The extraction captures volume, reporter, and page correctly but doesn't parse the(Court Year)parenthetical that follows.Reproduction
Additional failing examples from SCOTUS text:
491 U.S. 397, 404 (1989)418 U.S. 405, 409 (1974)468 U.S. 288, 294 (1984)391 U.S. 367, 376 (1968)Context
The Python eyecite library extracts year and court from the trailing parenthetical as core metadata on
FullCaseCitationobjects. This is critical for:Related Issues
(Court Year)formatExpected Behavior
The parenthetical following a case citation should be parsed for:
(1989),(9th Cir. 2020)(9th Cir. 2020),(D. Mass. 2019),(S.D.N.Y. 2021)U.S.,S. Ct.,L. Ed.), court should be inferred asscotuseven when not explicitly stated in the parenthetical