clean: Clean subtitles

clean_tagsR Documentation

Clean subtitles

Description

Functions to clean subtitles. clean_tags cleans formatting tags. clean_captions cleans close captions, i.e all text enclosed in parentheses or squared brackets. clean_patterns provides a more general and flexible cleaning based on regular expressions.

Usage

clean_tags(x, format = "srt", clean.empty = TRUE)

clean_captions(x, clean.empty = TRUE)

clean_patterns(x, pattern, clean.empty = TRUE)

Arguments

x

a subtitles or multisubtitles object.

format

the original format of the subtitles objects.

clean.empty

logical. Should empty remaining lines ("") deleted after cleaning.

pattern

a character string containing a regular expression to be matched and cleaned.

Value

A subtitles or multisubtitles object.


subtools documentation built on March 24, 2026, 5:07 p.m.