def is_new_span(self, citation_id, span):
        """Check if this span is new and mark it as processed if it is."""
        # Handle invalid inputs
        if citation_id is None or citation_id == "" or span is None:
            return False

        # Initialize set for this citation ID if needed
        if citation_id not in self.processed_spans:
            self.processed_spans[citation_id] = set()

        # Check if we've seen this span before for this citation
        if span in self.processed_spans[citation_id]:
            return False

        # This is a new span, track it
        self.processed_spans[citation_id].add(span)

        # Also track by citation ID for easy lookup
        if citation_id not in self.citation_spans:
            self.citation_spans[citation_id] = []

        self.citation_spans[citation_id].append(span)
        return True
Check if this span is new and mark it as processed if it is.
py/tests/unit/retrieval/test_citations.py