st_script_text_df: Curate nested scripts to data frames

Description Usage Arguments Details Value Examples

View source: R/episodes.R

Description

Curate nested vectors of script lines to data frames.

Usage

1
st_script_text_df(x, reset_line_numbers = TRUE)

Arguments

x

a vector of lines of script. See example.

reset_line_numbers

logical, adjust line numbers consistently and based on resulting data frame rows containing spoken lines.

Details

This function works well for all scripts, though imperfectly. There are some rare instances of two-column text formatting in original scripts. This edge case is not currently handled. Data extracted from original scripts is more informative and complete than those for which only caption-based transcriptions are available.

Value

a data frame

Examples

1
2
3
4
5
## Not run: 
x <- st_script_download("data-raw/episode_scripts", TRUE)
system.time(x <- dplyr::mutate(x, text2 = purrr::map(text, st_script_text_df))) # ~10 minutes

## End(Not run)

leonawicz/trekdata documentation built on Nov. 21, 2020, 11:19 a.m.