#' Process Raw Interview Transcript to Reconstructed Dialogue
#'
#' This function processes a raw interview transcript through a series
#' of steps to extract speaker turns and reconstruct the dialogue in
#' a human-readable format. It identifies speakers, generates regular
#' expression patterns for their tags, structures the data, extracts
#' interventions, and then prepends speaker tags back to each line.
#'
#' @param interview A character vector representing the raw interview 
#'   transcript (as returned by `read_interview`). The lines should be
#'   tagged with speaker names within square brackets 
#'   (e.g., "\\[Speaker1\\] This is a line").
#'
#' @return A character vector where each element represents a line of 
#'   dialogue, with the corresponding speaker tag prepended (e.g., 
#'   "\[Speaker Name\] Intervention text").
#'
#' @examples
#' # Example Usage:
#' # processed_interview = process_interview(intrw)
#'
#' @family process interview
#' 
#' @export

process_interview = function(interview){
    speaker = retrieve_speaker(interview)
    pattern = generate_speaker_pattern(speaker)
    result = prep_interview(interview)
    result = process_structured_interview(result, pattern)
    result = unlist_processed_interview(result)
    return(result)
}