Skip to contents

Get a primary text by URN.

Usage

get_perseus_text(urn, excerpt = NULL)

Arguments

urn

Valid uniform resource number (URN) obtained from perseus_catalog.

excerpt

An index to excerpt the text. For example, the first four "verses" of a text might be 1.1-1.4. If NULL, the entire work is returned.

Value

A seven column tbl_df with one row for each "section" (splits vary from text--could be line, chapter, etc.). Columns:

text

character vector of text

urn

Uniform Resource Number

group_name

Could refer to author (e.g. "Aristotle") or corpus (e.g. "New Testament")

label

Text label, e.g. "Phaedrus"

description

Text description

language

Text language, e.g. "grc" = Greek, "lat" = Latin, "eng" = English

section

Text section or excerpt if specified

Examples

get_perseus_text("urn:cts:greekLit:tlg0013.tlg028.perseus-grc2")
#> Warning: `data_frame()` was deprecated in tibble 1.1.0.
#> Please use `tibble()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
#> # A tibble: 18 × 7
#>    text       urn       group_name label      description       language section
#>    <chr>      <chr>     <chr>      <chr>      <chr>             <chr>      <int>
#>  1 Παλλάδ’ Ἀ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            1
#>  2 γλαυκῶπιν… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            2
#>  3 παρθένον … urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            3
#>  4 Τριτογενῆ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            4
#>  5 σεμνῆς ἐκ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            5
#>  6 χρύσεα, π… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            6
#>  7 ἀθανάτους… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            7
#>  8 ἐσσυμένως… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            8
#>  9 σείσασ’ ὀ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc            9
#> 10 δεινὸν ὑπ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           10
#> 11 σμερδαλέο… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           11
#> 12 κύμασι πο… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           12
#> 13 ἐξαπίνης:… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           13
#> 14 ἵππους ὠκ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           14
#> 15 εἵλετ’ ἀπ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           15
#> 16 Παλλὰς Ἀθ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           16
#> 17 καὶ σὺ μὲ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           17
#> 18 αὐτὰρ ἐγὼ… urn:cts:… Homeric H… Hymn 28 t… Hymni Homerici, … grc           18
get_perseus_text("urn:cts:latinLit:stoa0215b.stoa003.opp-lat1")
#> # A tibble: 69 × 7
#>    text         urn         group_name    label description     language section
#>    <chr>        <chr>       <chr>         <chr> <chr>           <chr>      <int>
#>  1 f Tibique, … urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            1
#>  2 et illa mol… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            2
#>  3 te sempiter… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            3
#>  4 et nos imag… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            4
#>  5 amen sonamu… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            5
#>  6 Te septem p… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            6
#>  7 ceu ciuitat… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            7
#>  8 solio propi… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            8
#>  9 et nos imag… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat            9
#> 10 amen sonamu… urn:cts:la… Orientius Sa… Orat… Orientius Sain… lat           10
#> # … with 59 more rows
get_perseus_text(urn = "urn:cts:greekLit:tlg0031.tlg009.perseus-grc2", excerpt = "5.1-5.5")
#> # A tibble: 1 × 7
#>   text           urn        group_name label description        language section
#>   <chr>          <chr>      <chr>      <chr> <chr>              <chr>    <chr>  
#> 1 Τῇ ἐλευθερίᾳ … urn:cts:g… New Testa… Gala… The New Testament… grc      5.1-5.5