scaife-viewer / beyond-translation-site

Site used to iterate on translation alignments within the Scaife Viewer ecosystem
3 stars 4 forks source link

generating transliterations of greek #91

Open gregorycrane opened 2 years ago

gregorycrane commented 2 years ago

Can you point me to the library you use to generate the transliterations of the Greek? (Ideally, in Python!)

jacobwegner commented 2 years ago

@gregorycrane: Sure!

We're using the PyICU library which provides bindings to the C++ libraries for ICU.

Here is a commit showing how the ICU transliterator instance is being set up within Beyond Translation:

https://github.com/scaife-viewer/backend/commit/9cf0449f0160c66a7024e115621f9d0228c679f5

and a generalized snippet:

import icu

icu_transliterator = icu.Transliterator.createInstance("Any-Latin")
value = "μῆνιν"
translit_value = icu_transliterator.transliterate(value)
print(translit_value)
# mē̂nin