def split_by_punctuation(
            self,
            punctuation: Union[List[str], List[Tuple[str, str]], str],
            lock: bool = False,
            newline: bool = False,
            min_words: Optional[int] = None,
            min_chars: Optional[int] = None,
            min_dur: Optional[int] = None,
            ignore_special_periods: bool = False
    ) -> "WhisperResult":
        """
        Split (in-place) segments at words that start/end with ``punctuation``.

        Parameters
        ----------
        punctuation : list of str or list of tuple of (str, str) or str
            Punctuation(s) to split segments by.
        lock : bool, default False
            Whether to prevent future splits/merges from altering changes made by this method.
        newline : bool, default False
            Whether to insert line break at the split points instead of splitting into separate segments.
        min_words : int, optional
            Split segments with words >= ``min_words``.
        min_chars : int, optional
            Split segments with characters >= ``min_chars``.
        min_dur : int, optional
            Split segments with duration (in seconds) >= ``min_dur``.
        ignore_special_periods : bool, default False
            Whether to avoid splitting at periods that is likely not an indication of the end of a sentence.

        Returns
        -------
        stable_whisper.result.WhisperResult
            The current instance after the changes.
        """
        def _over_max(x: Segment):
            return (
                    (min_words and len(x.words) >= min_words) or
                    (min_chars and x.char_count() >= min_chars) or
                    (min_dur and x.duration >= min_dur)
            )

        indices = set(s.id for s in self.segments if _over_max(s)) if any((min_words, min_chars, min_dur)) else None

        def _get_indices(x: Segment):
            return x.get_punctuation_indices(punctuation) if indices is None or x.id in indices else []

        ignore_special_periods = self._ignore_special_periods or ignore_special_periods
        self._split_segments(
            _get_indices,
            lock=lock,
            newline=newline,
            ignore_special_periods=ignore_special_periods
        )
        punct_str = '/'.join(p if isinstance(p, str) else '*'.join(p) for p in punctuation)
        self._update_history(
            f'sp={punct_str}+{int(lock)}+{int(newline)}+{min_words or ""}'
            f'+{min_chars or ""}+{min_dur or ""}+{int(ignore_special_periods)}'
        )
        return self

        Split (in-place) segments at words that start/end with ``punctuation``.

        Parameters
        ----------
        punctuation : list of str or list of tuple of (str, str) or str
            Punctuation(s) to split segments by.
        lock : bool, default False
            Whether to prevent future splits/merges from altering changes made by this method.
        newline : bool, default False
            Whether to insert line break at the split points instead of splitting into separate segments.
        min_words : int, optional
            Split segments with words >= ``min_words``.
        min_chars : int, optional
            Split segments with characters >= ``min_chars``.
        min_dur : int, optional
            Split segments with duration (in seconds) >= ``min_dur``.
        ignore_special_periods : bool, default False
            Whether to avoid splitting at periods that is likely not an indication of the end of a sentence.

        Returns
        -------
        stable_whisper.result.WhisperResult
            The current instance after the changes.
        
stable_whisper/result.py