isolateCharacterSpeech

0th

Percentile

Isolate Character Speech

isolateCharacterSpeech() isolates the speeches of individual characters and optionally saves them in seperate 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

Aliases
  • isolateCharacterSpeech
Examples
# NOT RUN {
data(rksp.0)
isolateCharacterSpeech(rksp.0, segment="Scene", writeToFiles=FALSE)
# }
Documentation reproduced from package DramaAnalysis, version 3.0.0, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.