def _has_incomplete_patterns(self, text: str) -> bool:
        """Check if text contains incomplete pattern pairs.

        Determines whether the text contains any start patterns without
        matching end patterns, which would indicate incomplete content.

        Args:
            text: The text to check.

        Returns:
            True if there are incomplete patterns, False otherwise.
        """
        for pattern_id, pattern_info in self._patterns.items():
            start = pattern_info["start"]
            end = pattern_info["end"]

            # Count occurrences
            start_count = text.count(start)
            end_count = text.count(end)

            # If there are more starts than ends, we have incomplete patterns
            if start_count > end_count:
                return True

        return False
Check if text contains incomplete pattern pairs.

        Determines whether the text contains any start patterns without
        matching end patterns, which would indicate incomplete content.

        Args:
            text: The text to check.

        Returns:
            True if there are incomplete patterns, False otherwise.
        
src/pipecat/utils/text/pattern_pair_aggregator.py