def apply_min_dur(self, min_dur: float, inplace: bool = False):
        """
        Merge any word/segment with adjacent word/segment if its duration is less than ``min_dur``.
        """
        result = self if inplace else deepcopy(self)
        max_i = len(result.segments) - 1
        if max_i == 0:
            return result
        for i in reversed(range(len(result.segments))):
            if max_i == 0:
                break
            if result.segments[i].duration < min_dur:
                if i == max_i:
                    result.add_segments(i-1, i, inplace=True, reassign_ids=False)
                elif i == 0:
                    result.add_segments(i, i+1, inplace=True, reassign_ids=False)
                else:
                    if result.segments[i+1].duration < result.segments[i-1].duration:
                        result.add_segments(i-1, i, inplace=True, reassign_ids=False)
                    else:
                        result.add_segments(i, i+1, inplace=True, reassign_ids=False)
                max_i -= 1
        result.reassign_ids()
        for s in result.segments:
            s.apply_min_dur(min_dur, inplace=True)
        return result

        Merge any word/segment with adjacent word/segment if its duration is less than ``min_dur``.
        
stable_whisper/result.py