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

fix(nytrial): Citation type in extract_from_text #857

Merged
merged 1 commit into from
Jan 12, 2024
Merged
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
10 changes: 10 additions & 0 deletions juriscraper/opinions/united_states/state/nyclaimsct.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
from typing import List

from juriscraper.opinions.united_states.state import nytrial


class Site(nytrial.Site):
court_regex = r"^Ct Cl|C(our)?t( [Oo]f)? Cl(aims)?$"

def _get_child_courts(self) -> List[str]:
"""Return an empty string as child_court, since the
New York Court of Claims in this source has no children

:return: list of empty strings
"""
return ["" for _ in self.cases]
1 change: 1 addition & 0 deletions juriscraper/opinions/united_states/state/nytrial.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def extract_from_text(self, scraped_text: str) -> Dict[str, Any]:
}
if cite_match:
metadata["Citation"] = cite_match.groupdict("")
metadata["Citation"]["type"] = 2 # 'State' type in courtlistener
if full_case:
full_case = harmonize(full_case)
metadata["Docket"]["case_name_full"] = full_case
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"docket_numbers": "",
"citations": "2023 NY Slip Op 51366(U)",
"case_name_shorts": "Leibovitz",
"child_courts": "Ct Claims"
"child_courts": ""
},
{
"case_dates": "2023-11-22",
Expand All @@ -21,7 +21,7 @@
"docket_numbers": "",
"citations": "2023 NY Slip Op 23376",
"case_name_shorts": "Delgado",
"child_courts": "Ct Claims"
"child_courts": ""
},
{
"case_dates": "2023-10-16",
Expand All @@ -33,7 +33,7 @@
"docket_numbers": "",
"citations": "2023 NY Slip Op 23371",
"case_name_shorts": "G.P.",
"child_courts": "Ct Claims"
"child_courts": ""
},
{
"case_dates": "2023-10-03",
Expand All @@ -45,7 +45,7 @@
"docket_numbers": "",
"citations": "2023 NY Slip Op 51330(U)",
"case_name_shorts": "Afanador",
"child_courts": "Ct Claims"
"child_courts": ""
},
{
"case_dates": "2023-09-05",
Expand All @@ -57,7 +57,7 @@
"docket_numbers": "",
"citations": "2023 NY Slip Op 51361(U)",
"case_name_shorts": "",
"child_courts": "Ct Claims"
"child_courts": ""
},
{
"case_dates": "2023-08-02",
Expand All @@ -69,6 +69,6 @@
"docket_numbers": "",
"citations": "2023 NY Slip Op 51336(U)",
"case_name_shorts": "Bracero",
"child_courts": "Ct Claims"
"child_courts": ""
}
]
10 changes: 10 additions & 0 deletions tests/local/test_ScraperExtractFromTextTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "81",
"reporter": "Misc 3d",
"page": "1215(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": '1125 Morris Avenue Realty LLC, Plaintiff(s), against Title Issues Agency LLC, MARTIN E. KOFMAN, STEVEN LOWENTHAL, ESQ., and LOWENTHAL PC, "JOHN DOE," "JANE DOE," "ABC CORPORATION," AND "XYZ CORPORATION," Defendant(s).'
Expand Down Expand Up @@ -239,6 +240,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "66",
"reporter": "Misc 3d",
"page": "1213(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "The People of the State of New York, against J.S., Adolescent Offender."
Expand Down Expand Up @@ -277,6 +279,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "81",
"reporter": "Misc 3d",
"page": "1211(A)",
"type": 2,
},
},
),
Expand All @@ -295,6 +298,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "78",
"reporter": "Misc 3d",
"page": "1203(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "Probate Proceeding, Will of Pia Jeong Yoon, a/k/a PIA JEONG AE YOON, a/k/a PIA J. YOON, a/k/a JEONG YOON, a/k/a JEONG AE YOON"
Expand Down Expand Up @@ -324,6 +328,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "66",
"reporter": "Misc 3d",
"page": "1210(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "In the Matter of a Proceeding Under Article 6 of the Family Court Act Robyn C., against William M. J. (Deceased) and EVA JANE P."
Expand All @@ -343,6 +348,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "73",
"reporter": "Misc 3d",
"page": "1238(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "In the Matter of a Proceeding for Support Under Article 4 of the Family Court Act Michelle B., against Thomas Y."
Expand All @@ -364,6 +370,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "58",
"reporter": "Misc 3d",
"page": "1215(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "The People of the State of New York against Amela Hot"
Expand All @@ -383,6 +390,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "59",
"reporter": "Misc 3d",
"page": "1211(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "The People of the State of New York, against James Smith"
Expand Down Expand Up @@ -415,6 +423,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "78",
"reporter": "Misc 3d",
"page": "1211(A)",
"type": 2,
},
},
),
Expand All @@ -433,6 +442,7 @@ class ScraperExtractFromText(unittest.TestCase):
"volume": "81",
"reporter": "Misc 3d",
"page": "1210(A)",
"type": 2,
},
"OpinionCluster": {
"case_name_full": "Alistair Sims, against Lance Frantz Regis A/K/A LANCE REGIS A/K/A LANCE F. REGIS A/K/A FRANTZ L. REGISTRE A/K/A REGISTRE FRANTZ A/K/A VANCE REGIS A/K/A REGIS LANCE A/K/A REGIS L. FRANTZ, Defendant(s)."
Expand Down
Loading