def find_secondary_structure_segments(sse_string, offset=0):
    """
    Identify segments of secondary structure elements in string

    Parameters
    ----------
    sse_string : str
        String with secondary structure states of sequence
        ("H", "E", "-"/"C")
    offset : int, optional (default: 0)
        Shift start/end indices of segments by this offset

    Returns
    -------
    start : int
        Index of first position (equal to "offset")
    end : int
        Index of last position
    segments : list
        List of tuples with the following elements:

        1. secondary structure element (str)
        2. start position of segment (int)
        3. end position of segment, exlusive (int)
    """
    if len(sse_string) < 1:
        raise ValueError("Secondary structure string must have length > 0.")

    end = len(sse_string) - 1

    sse_list = list(sse_string)
    change_points = [
        (i, (c1, c2)) for (i, (c1, c2)) in
        enumerate(zip(sse_list[:-1], sse_list[1:]))
        if c1 != c2
    ]

    segments = []
    last_start = 0
    # set s2 for the case of only one continuous segment
    s2 = sse_string[0]
    for (p, (s1, s2)) in change_points:
        segments.append((s1, offset + last_start, offset + p + 1))
        last_start = p + 1
    segments.append((s2, offset + last_start, offset + end + 1))

    return offset, end + offset, segments