View source: R/search_cuts_srt.R
search_cuts_srt | R Documentation |
Subtitles in 'Subrib Title' .srt format will be created for each search result.
The subtitles will be inserted into the column defined in s@cuts.column.srt
.
search_cuts_srt( x, s, cutSpanBeforesec = NULL, cutSpanAftersec = NULL, outputFolder = NULL, speaker.show = TRUE, speaker.width = 3, speaker.ending = ":" )
x |
Corpus object. |
s |
Search object. |
cutSpanBeforesec |
Double; Start the cut some seconds before the hit to include some context; the default NULL will take the value as set in @cuts.span.beforesec of the search object. |
cutSpanAftersec |
Double; End the cut some seconds before the hit to include some context; the default NULL will take the value as set in @cuts.span.beforesec of the search object. |
outputFolder |
Character string; if parameter is not set, the srt subtitles will only be inserted in |
speaker.show |
Logical; if |
speaker.width |
Integer; width of speaker abbreviation, -1 for full name without shortening. |
speaker.ending |
Character string; string that is added at the end of the speaker name. |
Span
If you want to extend the cut before or after each search result, you can modify @cuts.span.beforesec
and @cuts.span.aftersec
in your search object.
If you want to modify the layout of the print transcripts, create a new layout object with mylayout <- methods::new("layout")
, modify the settings and pass it as argument l
.
Search object;
library(act) # Search mysearch <- act::search_new(examplecorpus, pattern="yo") # Create srt subtitles for all search results test <- act::search_cuts_srt (x=examplecorpus, s=mysearch) # Display srt subtitle of first three results cat(test@results[1:3, mysearch@cuts.column.srt]) # Create srt subtitle including 1 sec before and 5 sec after mysearch@cuts.span.beforesec = 1 mysearch@cuts.span.aftersec = 5 test <- act::search_cuts_srt (x=examplecorpus, s=mysearch) # Display srt subtitle of first results cat(test@results[1,mysearch@cuts.column.srt])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.