Skip to content

Commit

Permalink
fix(nh_u): fix bugs in years 2019-2022
Browse files Browse the repository at this point in the history
Solves: #1129

- Update API filter to proper values for 2019-2021
- Handle edge case for year 2022
  • Loading branch information
grossir committed Nov 20, 2024
1 parent 2567793 commit 35757be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion juriscraper/opinions/united_states/state/nh_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@


class Site(OpinionSiteLinear):
"""
Regular site:
https://www.courts.nh.gov/our-courts/supreme-court/orders-and-opinions/opinions
"""

# document_purpose = 1331 -> Supreme Court Opinion
base_filter = "{}@field_document_purpose|=|1331"
year_to_filter = {
Expand Down Expand Up @@ -111,7 +116,7 @@ def _process_html(self) -> None:
for match in self.docket_regex.finditer(case["title"])
]
)
if not docket:
if not docket and fields.get("field_description"):
docket_str = fields["field_description"][0]["#text"]
docket = self.docket_regex.search(docket_str).group(0)

Expand Down
7 changes: 7 additions & 0 deletions juriscraper/opinions/united_states/state/nh_u.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ class Site(nh_p.Site):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.status = "Unpublished"
self.year_to_filter.update(
{
2021: "@field_document_subcategory|=|1616",
2020: "@field_document_subcategory|=|1611",
2019: "@field_document_subcategory|=|1606",
}
)

0 comments on commit 35757be

Please sign in to comment.