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

Add detection of ridgelys notes and other irregular reporters #189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions tests/test_FindTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,71 @@ def test_find_citations(self):
# Long pin cite -- make sure no catastrophic backtracking in regex
('1 U.S. 1, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2286, 2287, 2288, 2289, 2290, 2291',
[case_citation(metadata={'pin_cite': '2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2286, 2287, 2288, 2289, 2290, 2291'})]),
# Test volume nominative reporter
("Ridgely's Notebook, 362",
[case_citation(volume=None,
reporter="Ridgely's Notebook",
groups={'volume': None,
'reporter': "Ridgely's Notebook",
'page': '362'}
)]),
# Test volume nominative reporter with right single quotation mark
('Bayard’s Notebook, 235',
[case_citation(volume=None,
reporter="Bayard’s Notebook",
groups={'volume': None,
'reporter': 'Bayard’s Notebook',
'page': '235'}
)]),
# Test citation with parallel citation in parentheses
('24 Del. (1 Boyce) 1',
[case_citation(reporter="Del.",
groups={'volume': '24',
'reporter': 'Del.',
'parallel_volume': '1',
'parallel_reporter': 'Boyce',
'page': '1'}
)]),
# Test citation with parallel citation in parentheses and year
('Smith v. Henry, 18 S.C.L. (2 Bail.) 118 (1831)',
[case_citation(reporter="S.C.L.",
year=1831,
groups={'volume': '18',
'reporter': 'S.C.L.',
'parallel_volume': '2',
'parallel_reporter': 'Bail.',
'page': '118'},
metadata={'plaintiff': 'Smith',
'defendant': 'Henry'}
)]),
# Test citation with P
('Metzler v. Arcadian Corp. 1997 OSHD (CCH) P31,311',
[case_citation(reporter="OSHD (CCH)",
groups={'volume': '1997',
'reporter': 'OSHD (CCH)',
'page': '31,311'},
metadata={'plaintiff': 'Metzler',
'defendant': 'Arcadian Corp.'}
)]),
# Test another citation with P
('CCH OSHD P 20,091 (1975)',
[case_citation(reporter="CCH OSHD",
year=1975,
groups={'volume': None,
'reporter': 'CCH OSHD',
'page': '20,091'}
)]),
# Test hyphenated volume
('Williams v. IRS, 2007-2 U.S. Tax Cas. (CCH) P50,568 (E.D. Mo. 2007)',
[case_citation(reporter="U.S. Tax Cas. (CCH)",
groups={'volume': '2007-2',
'reporter': 'U.S. Tax Cas. (CCH)',
'page': '50,568'},
metadata={'plaintiff': 'Williams',
'defendant': 'IRS',
'court': 'moed',
'year': '2007'}
)]),
)
# fmt: on
self.run_test_pairs(test_pairs, "Citation extraction")
Expand Down
Loading