From 7aadd392d5ae4dc20a2525751749072dbaec5f81 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 10 Jul 2025 14:36:53 -0400 Subject: [PATCH 1/2] Fix removal of lowercase words in plaintiff --- eyecite/helpers.py | 3 +-- tests/test_FindTest.py | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eyecite/helpers.py b/eyecite/helpers.py index 84213cb..b5a99f8 100644 --- a/eyecite/helpers.py +++ b/eyecite/helpers.py @@ -363,8 +363,7 @@ def _process_case_name( else: plaintiff, defendant = "", splits[0] plaintiff = plaintiff.strip(f"{whitespace},(") - clean_plaintiff = re.sub(r"\b[a-z]\w*\b", "", plaintiff) - plaintiff = strip_stop_words(clean_plaintiff) + plaintiff = strip_stop_words(plaintiff) citation.metadata.plaintiff = plaintiff else: defendant = candidate_case_name diff --git a/tests/test_FindTest.py b/tests/test_FindTest.py index 13bfe01..b6762e5 100644 --- a/tests/test_FindTest.py +++ b/tests/test_FindTest.py @@ -828,7 +828,14 @@ def test_find_citations(self): # Fix for index error when searching for case name ("

State v. Luna-Benitez (S53965). Alternative writ issued, dismissed, 342 Or 255

", [case_citation(volume="342", reporter="Or", page="255")], - {'clean_steps': ['html', 'inline_whitespace']}) + {'clean_steps': ['html', 'inline_whitespace']}), + # Previously, this test would fail because lowercase words were removed from + # the plaintiff name. + ('City of Davis v. Coleman, 521 F.2d 661 (9th Cir. 1975)', + [case_citation(volume='521', reporter='F.2d', page='661', year=1975, + metadata={'plaintiff': 'City of Davis', + 'defendant': 'Coleman', + 'court': 'ca9'})]) ) # fmt: on From 79f644da929dd9047bf324b67b18aa54bd41d67f Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 10 Jul 2025 14:41:21 -0400 Subject: [PATCH 2/2] CHANGES --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 8e4ab05..d2d8b1f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Changes: Fixes: - Modifies rendering of AhocorasickTokenizer parameter in API docs II +- No longer removing lowercase words from plaintiff ## Current