Introduction

rperseus provides tools to get and analyze classical texts. Version 0.1.2 includes:

library(rperseus)
head(perseus_catalog)

A snapshot of available authors:

library(dplyr)
count(perseus_catalog, group_name, sort = TRUE)

Getting a Text

Once you've identified the relevant URN, paste it into a call to get_perseus_text. Here I've called for the Greek text of Plato's Crito:

crito <- get_perseus_text(urn = "urn:cts:greekLit:tlg0059.tlg003.perseus-grc2")
crito$text[1]

Getting Multiple Texts with the tidyverse

You can collect all of Plato's available English translations with the tidyverse:

plato <- perseus_catalog %>% 
  filter(group_name == "Plato",
         language == "eng") %>% 
  pull(urn) %>% 
  map_df(get_perseus_text)

Rendering Parallels

You can render small parallels with perseus_parallel:

tibble::tibble(label = c("Colossians", "1 Thessalonians", "Romans"),
              excerpt = c("1.4", "1.3", "8.35-8.39")) %>%
    dplyr::left_join(perseus_catalog) %>%
    dplyr::filter(language == "grc") %>%
    dplyr::select(urn, excerpt) %>%
    as.list() %>%
    purrr::pmap_df(get_perseus_text) %>%
    perseus_parallel(words_per_row = 4)

Parsing Excerpts

You can parse any Greek excerpt with parse_excerpt. A data frame is returned including part of speech, person, number, tense, mood, voice, gender, case, and degree.

parse_excerpt("urn:cts:greekLit:tlg0031.tlg002.perseus-grc2", "5.1-5.3")


ropensci/rperseus documentation built on June 28, 2023, 8:17 a.m.