diff --git a/annotate.html b/annotate.html index 6996543..71a9c84 100644 --- a/annotate.html +++ b/annotate.html @@ -216,7 +216,7 @@
eyecite.annotate
eyecite.models
eyecite.models
eyecite.models
Metadata
add_metadata
comparison_hash
comparison_hash
corrected_citation
corrected_citation_full
corrected_reporter
Return hash that will be the same if two cites are semantically -equivalent.
def comparison_hash(self) -> int:
"""Return hash that will be the same if two cites are semantically
- equivalent."""
- return hash((type(self), tuple(self.groups.items())))
+ equivalent, unless the citation is a CaseCitation missing a page.
+ """
+ if isinstance(self, CaseCitation) and self.groups["page"] is None:
+ return id(self)
+ else:
+ return hash((type(self), tuple(self.groups.items())))
@@ -1325,7 +1348,7 @@ Inherited members
Metadata
add_metadata
-comparison_hash
+comparison_hash
corrected_citation
corrected_reporter
dump
@@ -1392,7 +1415,7 @@ Inherited members
Metadata
add_metadata
-comparison_hash
+comparison_hash
corrected_citation
corrected_citation_full
corrected_reporter
@@ -1473,7 +1496,7 @@ Inherited members
Metadata
add_metadata
-comparison_hash
+comparison_hash
corrected_citation
corrected_citation_full
corrected_reporter
@@ -1565,7 +1588,7 @@ Inherited members
Metadata
add_metadata
-comparison_hash
+comparison_hash
corrected_citation
corrected_citation_full
corrected_reporter
@@ -1856,7 +1879,12 @@ Class variables
def __hash__(self):
"""Resources are the same if their citations are semantically
- equivalent."""
+ equivalent.
+
+ Note: Resources composed of citations with missing page numbers are
+ NOT considered the same, even if their other attributes are identical.
+ This is to avoid potential false positives.
+ """
return self.citation.comparison_hash()
def __eq__(self, other):
@@ -2010,6 +2038,22 @@ Methods
self.guess_edition()
+
+def comparison_hash(self) ‑> int
+
Return hash that will be the same if two cites are semantically +equivalent.
def comparison_hash(self) -> int:
+ """Return hash that will be the same if two cites are semantically
+ equivalent."""
+ return hash((super().comparison_hash(), self.all_editions))
+
def corrected_citation(self)
CitationBase
:
Metadata
comparison_hash
corrected_citation_full
dump
matched_text
Metadata
add_metadata
comparison_hash
comparison_hash
corrected_citation
corrected_reporter
dump
add_metadata
all_editions
+comparison_hash
corrected_citation
corrected_reporter
edition_guess
diff --git a/resolve.html b/resolve.html
index 60c74f1..2e1d1ba 100644
--- a/resolve.html
+++ b/resolve.html
@@ -116,6 +116,13 @@ Module eyecite.resolve
) -> bool:
"""Return True if id_cite has a pin cite that can't be correct for the
given full_cite."""
+ # if full cite has a known missing page, this pin cite can't be correct
+ if (
+ type(full_cite) is FullCaseCitation
+ and full_cite.groups.get("page") is None
+ ):
+ return True
+
# if no pin cite, we're fine
if not id_cite.metadata.pin_cite:
return False