isolateCharacterSpeech() isolates the speeches of individual characters and optionally saves them in separate text files.
isolateCharacterSpeech()
isolateCharacterSpeech( drama, segment = c("Drama", "Act", "Scene"), minTokenCount = 0, countPunctuation = TRUE, writeToFiles = TRUE, dir = getOption("qd.datadir") )
A text (or multiple texts, as a QDDrama object)
"Drama", "Act", or "Scene". Determines on what segment-level the speech is isolated.
The minimal token count for a speech to be considered (default = 0)
Whether to include punctuation in minTokenCount (default = TRUE)
Whether to write each isolated speech into a new text file (default = TRUE)
The directory into which the files will be written (default = data directory)
A named list of character vectors, each corresponding to character speeches as defined by segment
segment
# NOT RUN { data(rksp.0) isolateCharacterSpeech(rksp.0, segment="Scene", writeToFiles=FALSE) # }
Run the code above in your browser using DataCamp Workspace