Skip to content

aegean.scripts.greek

greek

Greek script plugin.

Registers Greek as a Script and its bundled sample corpus loader. The script's nlp capability exposes the aegean.greek pipeline.

Greek

Bases: Script

Ancient Greek — the alphabetic script; the full NLP pipeline is on .nlp.

nlp property

nlp: ModuleType

The Greek NLP pipeline module (normalize/tokenize/syllabify/…).

ddbdp_db

ddbdp_db() -> Path

The path to the fetched DDbDP SQLite database (fetched + unpacked on first use).

Pass it to aegean.db.search() / stream() / from_sqlite() for memory-friendly, full-text-searchable access to the 57k papyri without materialising the whole corpus.

load_ddbdp

load_ddbdp(*, progress: Callable[[int, int], None] | None = None) -> Any

Load ALL of DDbDP as an in-memory Corpus (opt-in, fetched, CC BY 3.0).

WARNING: 57,331 papyri / ~4.4M tokens — this materialises the entire corpus (minutes of work) and costs several GB of RAM. For most work prefer the memory-friendly DB layer: aegean.db.search(ddbdp_db(), ...) for instant full-text search, or aegean.db.stream(ddbdp_db()) for flat-memory iteration. progress (optional) is called as progress(done, total) per materialised document (see aegean.db.from_sqlite), so a long load can show it is moving; the corpus is identical with or without it. The attribution travels with the corpus provenance; cite the DDbDP (papyri.info).

load_edh

load_edh() -> Any

Load the EDH Ancient-Greek inscriptions as a Corpus (opt-in, fetched, CC BY-SA).

One Document per inscription (id HDnnnnnn), the Greek reading tokenised into words, with the ancient place (meta.site), date (meta.period), modern find-place (meta.findspot), and the Trismegistos id + inscription type in meta.notes. The attribution travels with the corpus provenance; cite EDH (Heidelberg Academy of Sciences and Humanities).

load_igcyr

load_igcyr() -> Any

Load the Greek inscriptions of Cyrenaica as a Corpus (opt-in, fetched, CC BY-NC-SA 4.0).

One Document per inscription (igcyrNNN / gvcyrNNN), the Greek reading tokenised into words, with a descriptive title (meta.name), find-place (meta.site, e.g. "Cyrene"), and date (meta.period). Attribution travels with the corpus provenance; cite IGCyr/GVCyr.

load_iip

load_iip() -> Any

Load the IIP Greek inscriptions as a Corpus (opt-in, fetched, CC BY-NC 4.0).

One Document per inscription, the Greek reading tokenised into words, with the find-place (meta.site) and coordinates (meta.findspot). The CC BY-NC attribution travels with the corpus provenance; cite IIP (M. L. Satlow, Brown University; see NOTICE).

load_iospe

load_iospe() -> Any

Load the IOSPE Greek inscriptions as a Corpus (opt-in, fetched, CC BY).

One Document per inscription (id vol.num, e.g. "1.1"), the Greek reading tokenised into words, with the find-place (meta.site, e.g. "Tyras") and date (meta.period). The attribution travels with the corpus provenance; cite IOSPE (King's College London).

load_isicily

load_isicily() -> Any

Load the I.Sicily Greek inscriptions as a Corpus (opt-in, fetched, CC BY 4.0).

One Document per inscription (id ISicNNNNNN), carrying the Greek reading text tokenised into words, with the ancient find-place (meta.site, e.g. "Syracusae"), the date (meta.period), and the coordinates (meta.findspot) in the metadata. The provenance and CC BY licence travel with the corpus; see NOTICE for the citation.

load_nt

load_nt(book: str | None = None, *, ref: str | None = None, force: bool = False) -> Any

Load the Greek New Testament (Nestle 1904) as an annotated Corpus.

book selects one book by name or abbreviation ('John', 'Jn', '1Cor', 'Rev'); None returns the whole NT. ref selects within a book, mirroring load_work: '3' a chapter, '3.16' a verse, '3.16-3.18' / '3.16-18' a verse range, '3-5' a chapter range. One Document per chapter; every token carries a gold lemma, Robinson morph, Strong's number, reconciled UD upos, and the normalized form in Token.annotations. Token text, lemmas, and normalized forms are NFC-normalized at load time (the source edition mixes oxia and tonos precomposition), so gold strings compare byte-for-byte with the library's NFC output.

The full 27-book corpus is fetched to cache on first use (sha256-pinned CC0 asset, or PYAEGEAN_NT_CORPUS_URL). When that asset is unavailable the bundled sample (John 1 + Philemon) is used as an offline fallback (its provenance says so).

load_work

load_work(work: str, *, ref: str | None = None, source: str = 'auto', edition: str | None = None, force: bool = False) -> 'Corpus'

Load one Greek work from Perseus canonical-greekLit / First1KGreek.

work is the CTS-style id ("tlg0012.tlg001" = the Iliad). source is "perseus", "first1k", or "auto" (try both, in that order); edition picks a specific edition file when a work has several. The TEI file is fetched once into the cache (network on first use only).

ref selects a sub-section instead of the whole work — a citation address matching the work's structure: a textpart number ("1" = Iliad book 1), a nested div path ("1.2" = book 1, chapter 2 of a prose work), a verse line-range ("1.1-1.50" = book 1, lines 1–50), a marginal <milestone> marker outside the CTS <div> scheme (a Stephanus sub-page "17a", a Bekker line "1447a10" — the span to the next marked line — or a whole Bekker page-column "1447a", the physical page being the comma list "1447a,1447b"), or a comma list of any of these ("1.1,1.5", "1,3", "17a,17b") giving one Document per entry. A hyphen range must stay within a single textpart: "1.1-2.50" (crossing from book 1 into book 2) raises ValueError; use a comma list, or load each book separately and Corpus.merge the results. Without ref, the corpus is one Document per top-level textpart. The corpus provenance's citation is the canonical scholarly citation of exactly what was selected ("Homer, Iliad 1.1-1.50"; see canonical_citation), so corpus.cite() echoes the selection. <note>/<bibl> ride along in Document.meta.notes. Raises aegean.data.DataNotAvailableError when the work can't be found/fetched, or ValueError when ref matches nothing — that message names the work's declared citation scheme (cited by book.line); citation_scheme returns it directly.