Skip to contents

This function concatenates a vector of intervention strings after removing a specified regular expression pattern from each string. This is often used to remove speaker tags before combining multiple interventions into a single text block.

Usage

concatenate_intervention(intervention, pattern)

Arguments

intervention

A character vector containing individual intervention strings.

pattern

The regular expression pattern to be removed from each intervention string.

Value

A single string created by concatenating the cleaned intervention strings with spaces in between.

Examples

# Example usage:
speakers = retrieve_speaker(intrw)
pattern = generate_speaker_pattern(speakers)
structured_interview = prep_interview(intrw)
concatenated_text = so.ii:::concatenate_intervention(
     structured_interview[[1]], 
     pattern
)