Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Changes:
-

Fixes:
-
- Recognize Unicode en-dash (U+2013) and em-dash (U+2014) as pin-cite page-range separators, so ranges like `241–242` are no longer dropped

## Current

Expand Down
9 changes: 5 additions & 4 deletions eyecite/regexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ def reference_pin_cite_re(regexes):
)\ ? # optional space after label
)?
(?:
# page:paragraph cite, like 123:24-25 or 123:24-124:25:
\d+:\d+(?:-\d+(?::\d+)?)?|
# page range, like 12 or 12-13:
[*]?\d+(?:-\d+)?
# page:paragraph cite, like 123:24-25 or 123:24-124:25
# (the range separator may also be an en- or em-dash):
\d+:\d+(?:[-–—]\d+(?::\d+)?)?|
# page range, like 12 or 12-13 (or 12–13 / 12—13):
[*]?\d+(?:[-–—]\d+)?
)
"""

Expand Down
16 changes: 16 additions & 0 deletions tests/test_FindTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ def test_find_citations(self):
'defendant': 'Test',
'court': 'pasuperct',
'pin_cite': '347-348'})]),
# Pin-cite page range with a Unicode en-dash (U+2013); common
# in typeset opinions and OCR'd text. The full range must be
# captured, not truncated to the first page.
('bob Lissner v. Test 1 U.S. 12, 347–348 (4th Cir. 1982)',
[case_citation(page='12', year=1982,
metadata={'plaintiff': 'Lissner',
'defendant': 'Test',
'court': 'ca4',
'pin_cite': '347–348'})]),
# Pin-cite page range with a Unicode em-dash (U+2014).
('bob Lissner v. Test 1 U.S. 12, 347—348 (4th Cir. 1982)',
[case_citation(page='12', year=1982,
metadata={'plaintiff': 'Lissner',
'defendant': 'Test',
'court': 'ca4',
'pin_cite': '347—348'})]),
# Test with court string exact match
('Commonwealth v. Muniz, 164 A.3d 1189 (Pa. 2017)',
[case_citation(page='1189', reporter='A.3d', volume='164', year=2017,
Expand Down
Loading