def find_adjacent_segment_type(segments, time):
    """Find boundary type on left and right (NONSPEECH or SPEECH)"""
    # find previous segment type
    segments[0].append("NS")
    prev = segments[0]
    for i in range(1, len(segments)):
        if (segments[i][0] - time) > prev[2]:
            segments[i].append("NS")    # nonspeech
        else:
            segments[i].append("SC")    # speaker change
        prev = segments[i]
    # find following segment type
    for i in range(0, len(segments) - 1):
        if (segments[i][2] + time) < segments[i + 1][0]:
            segments[i].append("NS")    # nonspeech
        else:
            segments[i].append("SC")    # speaker change
    segments[len(segments) - 1].append("NS")
    return segments