Title: | Get Texts from the Perseus Digital Library |
---|---|
Description: | The Perseus Digital Library is a collection of classical texts. This package helps you get them. The available works can also be viewed here: <http://cts.perseids.org/>. |
Authors: | David Ranzolin [aut, cre] |
Maintainer: | David Ranzolin <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2024-11-27 03:40:06 UTC |
Source: | https://github.com/ropensci/rperseus |
Get a primary text by URN.
get_perseus_text(urn, excerpt = NULL)
get_perseus_text(urn, excerpt = NULL)
urn |
Valid uniform resource number (URN) obtained from |
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. |
A seven column tbl_df
with one row for each "section" (splits vary from text–could be line, chapter, etc.).
Columns:
character vector of text
Uniform Resource Number
Could refer to author (e.g. "Aristotle") or corpus (e.g. "New Testament")
Text label, e.g. "Phaedrus"
Text description
Text language, e.g. "grc" = Greek, "lat" = Latin, "eng" = English
Text section or excerpt if specified
get_perseus_text("urn:cts:greekLit:tlg0013.tlg028.perseus-grc2") get_perseus_text("urn:cts:latinLit:stoa0215b.stoa003.opp-lat1") get_perseus_text(urn = "urn:cts:greekLit:tlg0031.tlg009.perseus-grc2", excerpt = "5.1-5.5")
get_perseus_text("urn:cts:greekLit:tlg0013.tlg028.perseus-grc2") get_perseus_text("urn:cts:latinLit:stoa0215b.stoa003.opp-lat1") get_perseus_text(urn = "urn:cts:greekLit:tlg0031.tlg009.perseus-grc2", excerpt = "5.1-5.5")
A dictionary of Greek stop words
greek_stop_words
greek_stop_words
A data frame with 223 rows and 1 variable:
Greek stop word
Compiled manually by filtering prepositions, pronouns, conjunctions, particles, and articles.
This function parses a Greek excerpt from the Perseus Digital Library. Parsing includes part of speech, gender, case, mood, voice, tense, person, number, and degree.
parse_excerpt(urn, excerpt)
parse_excerpt(urn, excerpt)
urn |
a valid urn from the perseus_catalog object. |
excerpt |
a valid excerpt, e.g. 5.1-5.5 |
a data frame
parse_excerpt("urn:cts:greekLit:tlg0031.tlg002.perseus-grc2", "5.1-5.4")
parse_excerpt("urn:cts:greekLit:tlg0031.tlg002.perseus-grc2", "5.1-5.4")
A dataset containing the texts available from the Perseus Digital Library.
perseus_catalog
perseus_catalog
A data frame with 2291 rows and 5 variables:
Uniform Resource Number
Could refer to author (e.g. "Aristotle") or corpus (e.g. "New Testament")
Text label, e.g. "Phaedrus"
Text description
Text language, e.g. "grc" = Greek, "lat" = Latin, "eng" = English, "hpt" = Hebrew pointed text, "hct" = Hebrew consonantal text, "ger" = German, "oth" = other
http://cts.perseids.org/api/cts/?request=GetCapabilities
Render a text parallel with ggplot2
perseus_parallel(perseus_df, words_per_row = 6)
perseus_parallel(perseus_df, words_per_row = 6)
perseus_df |
a data frame obtained from |
words_per_row |
adjusts the words displayed per "row". |
a ggplot object
## Not run: tibble::tibble(label = c("Colossians", rep("1 Thessalonians", 2), "Romans"), excerpt = c("1.4", "1.3", "5.8", "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() ## End(Not run)
## Not run: tibble::tibble(label = c("Colossians", rep("1 Thessalonians", 2), "Romans"), excerpt = c("1.4", "1.3", "5.8", "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() ## End(Not run)
The package contains a catalog and a function. The catalog is perseus_catalog
and can be
perused to locate a particular text and its corresponding URN. Then pass the URN to get_perseus_text
to obtain the text.
David Ranzolin [email protected]