read_srt: Read a subtitle file as data frame

Description Usage Arguments Details Value Examples

View source: R/read.R

Description

Convert the SubRip file format to a tabular data frame of times and text.

Usage

1
read_srt(path, collapse = "\n")

Arguments

path

A path or connection to an .srt file.

collapse

The character with which to separate subtitle lines.

Details

The SubRip format is a newline-separated, non-tabular text file with groups of subtitle text separated by a newline character and preceded by an index and a timestamp string containing the length of the spoken subtitle text. These components (index, time, text) can be parsed individually and combined into a data frame of subtitle groups.

Value

A data frame of subtitles.

Examples

1
2
# read linear text to tabular data
read_srt(srt_example("toy-story.en.srt"), " ")

srt documentation built on Nov. 30, 2020, 9:06 a.m.