def _match_length_from_index(
        self, text: str, window: str, text_index: int, window_index: int
    ) -> int:
        if not text or text[text_index] != window[window_index]:
            return 0
        return 1 + self._match_length_from_index(
            text, window + text[text_index], text_index + 1, window_index + 1
        )