Skip to content

Commit

Permalink
feat(eyecite): Update changelog
Browse files Browse the repository at this point in the history
Change type hint
move is parallel to fullcase citation
  • Loading branch information
flooie committed Mar 6, 2025
1 parent 9e576fe commit 57ccd66
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
7 changes: 4 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
The following changes are not yet released, but are code complete:

Features:
- None
- Adds support for years preceding citations

Changes:
- None
- Simplifies is parallel logic
- moves is parallel citation to full case citation

Fixes:
- None
- Fixes run on extra regex captures by capping at semicolons


## Current
Expand Down
37 changes: 18 additions & 19 deletions eyecite/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Hashable,
List,
Optional,
Self,
Sequence,
Tuple,
Union,
Expand Down Expand Up @@ -360,24 +359,6 @@ class FullCitation(ResourceCitation):
"""Abstract base class indicating that a citation fully identifies a
resource."""

def is_parallel_citation(self, preceding: Self):
"""Check if preceding citation is parallel
Args:
preceding (): The previous citation found
Returns: None
"""
if self.full_span_start == preceding.full_span_start:
# if parallel get plaintiff/defendant data from
# the earlier citation, since it won't be on the
# parallel one.
self.metadata.defendant = preceding.metadata.defendant
self.metadata.plaintiff = preceding.metadata.plaintiff
# California style may have a year prior to citation; merge as well
self.metadata.year = preceding.metadata.year
self.year = preceding.year


@dataclass(eq=False, unsafe_hash=False, repr=False)
class FullLawCitation(FullCitation):
Expand Down Expand Up @@ -507,6 +488,24 @@ class FullCaseCitation(CaseCitation, FullCitation):
```
"""

def is_parallel_citation(self, preceding: CaseCitation):
"""Check if preceding citation is parallel
Args:
preceding (): The previous citation found
Returns: None
"""
if self.full_span_start == preceding.full_span_start:
# if parallel get plaintiff/defendant data from
# the earlier citation, since it won't be on the
# parallel one.
self.metadata.defendant = preceding.metadata.defendant
self.metadata.plaintiff = preceding.metadata.plaintiff
# California style may have a year prior to citation; merge as well
self.metadata.year = preceding.metadata.year
self.year = preceding.year

@dataclass(eq=True, unsafe_hash=True)
class Metadata(CaseCitation.Metadata):
"""Define fields on self.metadata."""
Expand Down

0 comments on commit 57ccd66

Please sign in to comment.