search_cuts_printtranscript: Create print transcripts for all search results

View source: R/search_cuts_printtranscript.R

search_cuts_printtranscriptR Documentation

Create print transcripts for all search results

Description

Print transcripts in the style of conversation analysis will be created for each search result. The transcripts will be inserted into the column defined in s@cuts.column.printtranscript. All transcripts will be stored in s@cuts.printtranscripts.

Usage

search_cuts_printtranscript(
  x,
  s,
  cutSpanBeforesec = NULL,
  cutSpanAftersec = NULL,
  l = NULL,
  outputFolder = NULL
)

Arguments

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.

l

Layout object.

outputFolder

Character string; if parameter is not set, the print transcripts will only be inserted in s@results; if the path to a existing folder is given transcripts will be saved in '.txt' format.

Details

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.

Value

Search object;

Examples

library(act)

# Search
mysearch <- act::search_new(examplecorpus, pattern="yo")

# Create print transcripts for all search results
test <- act::search_cuts_printtranscript (x=examplecorpus, s=mysearch)

# Display all print transcripts on screen from @cuts.printtranscripts
cat(test@cuts.printtranscripts)

# Display all print transcripts from results data frame
cat(test@results[,mysearch@cuts.column.printtranscript])
cat(test@results[,mysearch@cuts.column.printtranscript])

# Only single print transcript from results data frame
cat(test@results[1,mysearch@cuts.column.printtranscript])

# Create print transcript snippets including 1 sec before and 5 sec after
mysearch@cuts.span.beforesec =1
mysearch@cuts.span.aftersec = 5
test <- act::search_cuts_printtranscript (x=examplecorpus,
s=mysearch)

# Display all transcript snippets on screen
cat(test@results[,mysearch@cuts.column.printtranscript])

act documentation built on June 7, 2023, 6:16 p.m.