Skip to main content

ancient-greek-backend-eee

Ancient Greek (ISO 639-2: grc) morphology backend for the Ελληνικά Εκπαιδευτικά Εργαλεία (EEE) — Greek Language Educational Tools.

Implements AncientGreekBackend, satisfying the MorphologyBackend protocol defined in the eee package.

🔓 Open source:

💬 Community: https://telegram.me/eee_greek

Wraps greek-inflexion-eee, a fork of James Tauber's greek-inflexion library. License: MIT.

Per the upstream README, the library "can precisely generate (i.e. without over-generation) all the forms in the verbal paradigms in Louise Pratt's The Essentials of Greek Grammar, Helma Dik's Nifty Greek Handouts, and Keller and Russell's Learn to Read Greek. It can also generate the nouns in Pratt." Nominal coverage in this package remains limited to those Pratt nouns — Dik's and Keller/Russell's nouns are not yet included.

Period: Classical Attic Greek (~5th–4th century BCE) is the base pattern — accentuation logic broadly follows Classical Attic conventions, and Ionic/Doric forms are not generated from the Pratt/Dik/LTRG teaching stems. The corpus lexicons (homer, lxx, morphgnt, lsj, morpheus, byzantine) extend vocabulary into other periods and dialects while reusing this same stemming and accentuation engine — see the period column in the lexicon tables below.

Installation

pip install ancient-greek-backend-eee

Development version (latest, from Codeberg):

pip install "ancient-greek-backend-eee @ git+https://codeberg.org/EEE-project/ancient-greek-backend-eee.git"

Usage

from ancient_greek_backend_eee import AncientGreekBackend

# Default: Pratt lexicon (20 teaching verbs)
backend = AncientGreekBackend()

# Corpus lexicon — by name
backend = AncientGreekBackend(lexicons=["homer"])

# Merged corpora
backend = AncientGreekBackend(lexicons=["homer", "lxx", "morphgnt"])

# Named historical period (avoids hand-copying the lexicon list; the lexicon
# names are an implementation detail behind the period, not the identifier)
backend = AncientGreekBackend.for_period("byzantine")
# same as: AncientGreekBackend(lexicons=["lxx", "morphgnt", "pratt", "ltrg", "lsj", "byzantine"])

# Other periods: "epic" (Homer), "attic" (Classical Attic — pratt+ltrg+lsj),
# "hellenistic_koine" (Septuagint), "roman_koine" (NT)

# ...with extra lexicons layered on top of the preset
backend = AncientGreekBackend.for_period("epic", extra_lexicons=["odyssey_morpheus"])

# Multiple periods union into one backend (order doesn't affect the result —
# lexicon merging is a set union, confirmed empirically, not a sequential
# override)
backend = AncientGreekBackend.for_period("epic", "attic", "hellenistic_koine", "roman_koine")

# Custom lexicon file (absolute path, same YAML format)
backend = AncientGreekBackend(lexicons=["pratt", "/path/to/my_course.yaml"])

forms = backend.inflect("ἀκούω", {
    "VerbForm": "Fin", "Tense": "Pres", "Voice": "Act",
    "Mood": "Imp", "Person": "2", "Number": "Sing"
}, "verb")
# {"ἄκουε"}

backend.analyze("βάλλω")
# [{"lemma": "βάλλω", "pos": "verb", "tag": "PAI.1S",
#   "features": {"Tense": "Pres", "VerbForm": "Fin", "Voice": "Act", "Mood": "Ind", "Person": "1", "Number": "Sing"}},
#  {"lemma": "βάλλω", "pos": "verb", "tag": "PAS.1S", ...}]  # syncretic with the subjunctive

Lexicon flavors

The lexicons parameter selects the vocabulary for verbs and nouns. Adjectives always use the bundled Pratt paradigm lexicon (no additional adj lexicons yet).

Verbs:

Name Verbs Source Period / dialect
"pratt" (default) 20 Pratt textbook teaching
"dik" 10 Dik textbook teaching
"ltrg" 34 LTRG textbook teaching
"homer" 2335 Homeric corpus Epic/Ionic, ~800 BCE
"lxx" 1905 Septuagint Biblical κοινή, ~250–100 BCE
"morphgnt" 1848 New Testament κοινή, ~1st c. CE
"lsj" 9 LSJ, hand-authored Classical Attic
"morpheus" 46 Morpheus-confirmed attested forms Epic/Homeric (mixed)

Nouns — Pratt base is always included; the others extend it:

Name Nouns Source
"pratt" 26 Pratt textbook paradigm nouns
"homer" 15 Homeric Odyssey/Iliad vocabulary
"lsj" 18 LSJ, hand-authored, Classical Attic
"morpheus" 62 Morpheus-confirmed attested forms, Epic/Homeric (mixed)

"lsj" and "morpheus" are hand-authored/Morpheus-confirmed respectively, not generated from a bulk corpus — see greek-inflexion-eee's own README for how each is built and its exact scope. "morpheus" holds verbatim attested forms (not stems: + generated endings) for lemmas the stem-based lexicons can't handle cleanly — athematic -μι verbs, contract verbs, compounds, deponents, non-2nd-declension nouns, oxytone nouns, and irregular/suppletive nouns (Ζεύς).

Multiple names are merged additively. Absolute file paths load custom YAML lexicons.

The same lexicons list is shared across every part of speech, even though not every name applies to every one (e.g. pronouns have no named lexicons at all yet) — a name irrelevant to the part of speech currently being asked about is fine and silently ignored, but a name that isn't registered anywhere raises ValueError (2026-07-31), regardless of which part of speech happens to be queried first. This used to silently degrade coverage with no signal at all — the exact failure shape when a lexicon name gets removed (as "odyssey_morpheus" was) while some caller still references it by name.

Auto-registered via two entry point groups on install:

  • eee_project.backends.v1 → key grc (default backend for Ancient Greek)
  • eee_project.named_backends.v1 → key ancient-greek (selectable via backend="ancient-greek")

This means eee.inflect(..., language="grc") and eee.inflect(..., backend="ancient-greek") both work without explicit registration.

For grc, unimorph-backend-eee is the other available backend. Coverage is complementary rather than one superseding the other: θεός is in this package only; βοηθός is in unimorph only.

Implementation

Rule-based generator. A YAML stem database stores principal stems (e.g. βαλλ, βαλ) for each lemma; stemming.yaml maps morphological keys to stem-slots and endings; a separate accentuation engine applies Attic accent rules. Forms are generated on demand — not pre-computed.

Adding a new lemma requires annotating its principal stems; the rule engine then generates the full paradigm automatically.

Limitations

  • Two-termination adjectives (ἀληθής, ἄδικος, μείζων, ἐυπλόκαμος) share Masc/Fem forms, generated directly under their own Masc and Fem keys in every bundled lexicon — no runtime fallback. There used to be one (_inflect_nominal: fall back to the Fem key when Masc was absent), added for ἀληθής specifically, but it fired for any adjective with a missing Masc key — confirmed silently wrong for ἴσος (regular 2-1-2, Masc/Fem genuinely differ), which returned the Fem form as if it were Masc rather than an empty set. Removed entirely once every genuinely-2-termination adjective's data was independently verified complete (real Perseids Morpheus lookups, not declension-class guessing) — see greek-inflexion-eee#3 and issue #11. Querying a gender an adjective genuinely lacks now always returns an empty set, never a wrong-gender substitute.
  • Nominal coverage is limited to Pratt. Nouns from Dik and Keller/Russell are not yet included.
  • analyze() (reverse lookup) has no disambiguation: it returns every candidate the underlying reverse-stemming produces, including known over-matches (e.g. a masc. 2nd-declension nominative singular currently also comes back tagged as fem. nom./acc. plural). It also does not cover pronouns — their lexicons are override-only with no stemming ruleset for parse() to walk, so pos="pronoun" is skipped rather than attempted.

Development

uv sync --dev
uv run pytest

Release files for ancient-greek-backend-eee 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ancient-greek-backend-eee 2.0.0
File Size Uploaded
ancient_greek_backend_eee-2.0.0.tar.gz 73.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ancient-greek-backend-eee 2.0.0
File Interpreter ABI Platform
ancient_greek_backend_eee-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 99.6 kB

Release files / ancient_greek_backend_eee-2.0.0.tar.gz

Download URL ancient_greek_backend_eee-2.0.0.tar.gz
Size 73.7 kB
Tags Source
SHA-256 checksum
How to use checksums
66ecbfa037d1ca7ff74eb4cb3e227e62c3bab72392f5460bd5d663e85a408417
BLAKE2b-256 checksum
How to use checksums
9391728ff92d8d69cb5014aa57c4763a73427851321e161e660a15fa1456b607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Release files / ancient_greek_backend_eee-2.0.0-py3-none-any.whl

Download URL ancient_greek_backend_eee-2.0.0-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c05bafbb2aa015d609204f110f626568d2ab6b001a6c80db15c829ff5bae46b6
BLAKE2b-256 checksum
How to use checksums
95083ef76e57ea00bce57f344ba66c8165d48eb8485a3e35f63c9f54bd278e7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.1

2 release files

This release

2.0.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page