get_text_chr_spoken: Retrieve lines and stage directions for a play

View source: R/text.R

get_text_chr_spokenR Documentation

Retrieve lines and stage directions for a play

Description

get_text_chr_spoken() request lines and stage directions for a play, given play and corpus names.

Usage

get_text_chr_spoken(
  play = NULL,
  corpus = NULL,
  gender = NULL,
  split_text = TRUE,
  ...
)

get_text_chr_spoken_bych(
  play = NULL,
  corpus = NULL,
  split_text = TRUE,
  as_data_frame = FALSE,
  ...
)

get_text_chr_stage(play = NULL, corpus = NULL, split_text = TRUE, ...)

get_text_chr_stage_with_sp(play = NULL, corpus = NULL, split_text = TRUE, ...)

Arguments

play

Character, name of a play (you can find all play names in "playName" column within an object returned by get_dracor). Character vector (longer than 1) is not supported.

corpus

Character, name of the corpus (you can find all corpus names in name column within an object returned by get_dracor_meta).

gender

Character, optional parameter to extract lines for characters of specified gender: "MALE", "FEMALE", "UNKNOWN".

split_text

If TRUE returns text as a character vector of lines. Otherwise, returns text as one character value. TRUE by default.

...

Additional arguments passed to dracor_api.

as_data_frame

If TRUE returns data frame with a row for every character and text in a column "text". Otherwise, a named list with character values is returned. FALSE by default.

Value

For get_text_chr_spoken(), get_text_chr_stage() and get_text_chr_stage_with_sp(): a character vector (if split_text = TRUE, the default value) or a single character value (if split_text = FALSE). For get_text_chr_spoken_bych():

split_text = TRUE and as_data_frame = FALSE (default)

a named list with character vectors for every character

split_text = FALSE and as_data_frame = FALSE

a named character vector (one value = one character)

split_text = TRUE and as_data_frame = TRUE

a data frame: every row represent a character, text of a play is stored in a "text" column, the "text" column is a list column with a character vector of lines

split_text = FALSE and as_data_frame = TRUE

a data frame: every row represent a character, text of a play is stored in a "text" column, the "text" column is a simple character column

Functions

  • get_text_chr_spoken_bych(): Retrieves lines grouped by characters in a play, given play and corpus names.

  • get_text_chr_stage(): Retrieves all stage directions of a play, given play and corpus names.

  • get_text_chr_stage_with_sp(): Retrieves all stage directions of a play including speakers (if applicable), given play and corpus names.

See Also

get_text_tei get_text_df

Examples

get_text_chr_spoken(play = "lessing-emilia-galotti", corpus = "ger")
get_text_chr_spoken(
  play = "lessing-emilia-galotti",
  corpus = "ger",
  gender = "FEMALE"
)
get_text_chr_spoken(
  play = "lessing-emilia-galotti",
  corpus = "ger",
  gender = "FEMALE",
  split_text = FALSE
)
get_text_chr_spoken_bych(
  play = "lessing-emilia-galotti",
  corpus = "ger"
)
get_text_chr_stage(
  play = "lessing-emilia-galotti",
  corpus = "ger"
)
get_text_chr_stage_with_sp(
  play = "lessing-emilia-galotti",
  corpus = "ger"
)

Pozdniakov/rdracor documentation built on April 9, 2024, 1:20 a.m.