DEV Community

Dimitris Tzemos
Dimitris Tzemos

Posted on

2 1

polytonic_to_monotonic.py (convert a polytonic ancient Greek document to monotonic)

https://github.com/djemos/polytonic_to_monotonic.py

This is a python program to convert a polytonic ancient Greek document to monotonic

Usage: python ./polytonic_to_monotonic.py polytonic_file monotonic_file

Save your ancient Greek polytonic text to a file e.g. polyt.txt then run

python ./remove_accents.py polyt.txt mono.txt
The mono.txt file will contain the monotonic text.

==Ancient Greek doc==
Ὦ κοινὸν αὐτάδελφον Ἰσμήνης κάρα,
ἆρ᾿ οἶσθ᾿ ὅ τι Ζεὺς τῶν ἀπ᾿ Οἰδίπου κακῶν
ὁποῖον οὐχὶ νῷν ἔτι ζώσαιν τελεῖ
Οὐδὲν γὰρ οὔτ᾿ ἀλγεινὸν οὔτ᾿ ἄτης ἄτερ
οὔτ᾿ αἰσχρὸν οὔτ᾿ ἄτιμόν ἐσθ᾿ ὁποῖον οὐ
τῶν σῶν τε κἀμῶν οὐκ ὄπωπ᾿ ἐγὼ κακῶν.
Καὶ νῦν τί τοῦτ᾿ αὖ φασι πανδήμῳ πόλει
κήρυγμα θεῖναι τὸν στρατηγὸν ἀρτίως;
Ἔχεις τι κεἰσήκουσας; ἤ σε λανθάνει
πρὸς τοὺς φίλους στείχοντα τῶν ἐχθρῶν κακά;

==mono.txt==
Ω κοινὸν αυτάδελφον Ισμήνης κάρα,
αρ᾿ οίσθ᾿ ό τι Ζεὺς τών απ᾿ Οιδίπου κακών
οποίον ουχὶ νων έτι ζώσαιν τελεί
Ουδέν γὰρ ούτ᾿ αλγεινὸν ούτ᾿ άτης άτερ
ούτ᾿ αισχρὸν ούτ᾿ άτιμόν εσθ᾿ οποίον ου
τών σών τε καμών ουκ όπωπ᾿ εγὼ κακών.
Καὶ νύν τί τούτ᾿ αύ φασι πανδήμω πόλει
κήρυγμα θείναι τὸν στρατηγὸν αρτίως;
Έχεις τι κεισήκουσας; ή σε λανθάνει
πρὸς τοὺς φίλους στείχοντα τών εχθρών κακά;

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay