Graphtos

Graphtos: a formal grammar model for New Testament Greek.

2024-06-10

I have been working for more than a year now on Graphtos, a formal Greek grammar model focused on the New Testament Greek (Koinè). It uses a rule-based model with explicit exceptions to inflect a word.

Ancient Greek, an Almost Mathematical Language

Ancient Greek follows a network of precise grammatical rules and predictable patterns, much like mathematical formulas — with only a few exceptions. Most words are inflected according to their role in the phrase. Knowing vocabulary is not enough. You must know how the words change according to what they do in the sentence.

Verbs are conjugated according to the tense (present, future, ...), mood (indicative, subjunctive, ...), voice (active, passive, middle), person (1st, 2nd, 3rd) and number (singular or plural), while nouns and adjectives are declined according to their gender (masculine, feminine, neuter), and number.

Each of these forms follows rules, that can be expressed quite formally, except for words that don't!

Graphtos is an attempt to build a formal model that captures these rules — and their exceptions.

What Does It Do?

Graphtos takes as input a Greek word, as it is in the dictionary, for instance αγαπαω, (to love), and a target form, for instance the first person plural indicative present (We love). It will then output the different steps and rules used to inflect the word, and predict an inflection.

Flexion of αγαπαω, indicative active aorist
Flexion of αγαπαω, indicative active aorist

A Formal Model?

The main goal of Graphtos is not to be extremely precise but to fully explain why the predicted inflection is what it is. It is aimed as a tool to make the learning of Ancient Greek easier. To do so, it should use as few rules as possible, and be able to justify why they are used.

We first define a base model that we can reuse for most words:

Example of one of the rules: the addition of a link letter between radical and ending for some tenses
Example of one of the rules: the addition of a link letter between radical and ending for some tenses

However, like any language, Ancient Greek is full of exceptions — and handling them is where Graphtos gets interesting. A static optimisation algorithm will try to add as few rules as possible to fix the exceptions. This might mean dropping a rule, using an alternative rule or ending, or trying a variation of the radical. These are called deviations. When deviations occur, the optimizer tries to find the most general one, also using related words (with prefixes) as additional examples to find the best explanation.

Example of deviations
Example of deviations

Going Further

You can access a simple demonstrator for the version 0.2.1 of the model, and the full design report:

Access the model demo Read the design report