diff --git a/eyecite/models.py b/eyecite/models.py index 0260d1d..5fff590 100644 --- a/eyecite/models.py +++ b/eyecite/models.py @@ -571,6 +571,9 @@ def merge(self, other: "Token") -> Optional["Token"]: self.variation_editions = cast( tuple, self.variation_editions ) + cast(tuple, other.variation_editions) + # Remove duplicate editions after merge + self.exact_editions = tuple(set(self.exact_editions)) + self.variation_editions = tuple(set(self.variation_editions)) return self return None diff --git a/tests/test_FindTest.py b/tests/test_FindTest.py index 5294398..47339f1 100644 --- a/tests/test_FindTest.py +++ b/tests/test_FindTest.py @@ -186,6 +186,10 @@ def test_find_citations(self): # Test with page number that is indicated as missing ('1 U.S. ___', [case_citation(volume='1', reporter='U.S.', page=None)]), + # Test with page number that is indicated as missing, followed by + # a comma (cf. eyecite#137) + ('1 U. S. ___,', + [case_citation(volume='1', reporter_found='U. S.', page=None)]), # Test with the 'digit-REPORTER-digit' corner-case formatting ('2007-NMCERT-008', [case_citation(source_text='2007-NMCERT-008', page='008',