Python modules for learning Greek

I’m looking for modules - or other methods - in the Python programming language to help me with Greek. What I need, specifically, is a way to lemmatize Greek words and if possible also translate them into their English lemma forms. The first of these is dealt with in Latin with the lamonpy module and the second can be done passably with the googletrans module. Does anybody know of anything similar for Greek? I don’t mind looking the words up manually (it helps one to remember), but lemmatization is a lot harder in Greek than Latin, and it would speed things up massively if I could automate the process.

I’m looking for modules - or other methods - in the Python programming language

Speaking about Python, the first thing coming to mind is The Classical Language Toolkit (CLTK), it has a lemmatize module for Ancient Greek. I din’t check it, but for Latin it was not very helpful.

I don’t mind looking the words up manually

If an online service is acceptable, then Eulexis is the most advanced lemmatizer to the date. It is better than Perseus Hopper; I haven’t compared it with Diogenes yet. Eulexis and Diogenes are table-based, Hopper uses a set of morphology rules.

The dictionary Morphologia Graeca is based on the Eulexis dataset. Using PyGlossary as a library, one can utilize it to find lemmas.

Thanks for the response. CLTK is way, way, way too complicated; it’s like learning an entirely new language. My purpose here is to optimise things and make them as easy as possible. Lamonpy can be used straight away, with no fuss.

As for the other things, I was vaguely aware of them, but really want something to integrate with pre-existing Python code.

The Eulexis code seems to be available on Github, linked from their site. What you’d want from this is the lemma map, which is in their data files, “analyses_gr.txt”, and contains all of the lemmas that Eulexis is capable of handling. It’s not generated from the grammars, but seems to date back to the old Morpheus runs on the Perseus texts, and therefore has the normal funny gaps. For example, looking over the λύω forms, it’s missing many (but not all) of the middle optative present and future, just as Perseus.

(Btw, I spent 20 minutes parsing through C++ code written in French to work out how it was doing its lemmas so you don’t have to.)

Thanks for your help. Much appreciated. To be honest, I think I’ll soldier through with cltk, but I notice it doesn’t have a method for translating Greek words to English. Like I said, for Latin I can use Python’s googletrans module, which is crude but accurate enough for single Latin lemmas. As everybody here will know, however, googletrans does not provide an Ancient Greek service.

I can manage to translate the words manually, but if there is some programmatical method in Python for translating GR-EN, it’d be helpful. The nearest thing I can think to do is take it from the parsed data from wiktionary, but that seems crude.

a method for translating Greek words to English

It was recently discussed in this topic.

I wouldn’t say cltk is super complicated. If all you want to do is lemmatize a word, this is code that does it:

from cltk.stem.lemma import LemmaReplacer
lemmatizer = LemmaReplacer(‘greek’)
print(lemmatizer.lemmatize(“Μῆνιν ἄειδε, θεά”))

If I just want to lemmatize a word quickly, all I do is go to U Chicago’s morpho:

https://logeion.uchicago.edu/morpho/λόγος

For instance, if you put in Μῆνιν, it tells you it’s a form of μῆνις.