DramaAnalysis (version 3.0.1)

isolateCharacterSpeech: Isolate Character Speech

Description

isolateCharacterSpeech() isolates the speeches of individual characters and optionally saves them in separate text files.

Usage

isolateCharacterSpeech(
  drama,
  segment = c("Drama", "Act", "Scene"),
  minTokenCount = 0,
  countPunctuation = TRUE,
  writeToFiles = TRUE,
  dir = getOption("qd.datadir")
)

Arguments

drama

A text (or multiple texts, as a QDDrama object)

segment

"Drama", "Act", or "Scene". Determines on what segment-level the speech is isolated.

minTokenCount

The minimal token count for a speech to be considered (default = 0)

countPunctuation

Whether to include punctuation in minTokenCount (default = TRUE)

writeToFiles

Whether to write each isolated speech into a new text file (default = TRUE)

dir

The directory into which the files will be written (default = data directory)

Value

A named list of character vectors, each corresponding to character speeches as defined by segment

Examples

Run this code
# NOT RUN {
data(rksp.0)
isolateCharacterSpeech(rksp.0, segment="Scene", writeToFiles=FALSE)
# }

Run the code above in your browser using DataCamp Workspace