Search code examples
rstringicustringi

Transliterate Latin to ancient Greek letters


There is a simple way to transform Latin letters to Greek letters, using the stringi package for R which relies on ICU's transliterator here:

library(stringi)
stri_trans_general("abcd", "latin-greek")

Is there a similar simple way to convert Latin to ancient Greek (αβγδ) instead of Greek (ἀβκδ)?


Solution

  • There are no real differences between the modern and the ancient greek alphabet. Maybe the biggest one is that the ancient greek alphabet did not have lowercase letters. So both αβγδ and ἀβκδ are modern greek (With the accent on alpha being probably something that has to do with pronunciation, modern greek does not have it any more).

    Now, what stri_trans_general does is transliterating while trying to take into account the pronunciation:

    pronounceable: transliteration is not as useful if the process simply maps the characters without any regard to their pronunciation. Simply mapping "αβγδεζηθ..." to "abcdefgh..." would yield strings that might be complete and unambiguous, but cannot be pronounced. (see here)

    There are different standards to do the transliteration, like ISO 843 and UN (see here and here). c can be transliterated as "κ" or "σ" and the former is chosen.


    Since SO is about programming, here is some code if you want to make your own mapping:

    ## You have to complete the mapping
    map <- data.frame(latin = c("a", "b", "c", "d", "e", "f", " "),
                      greek = c("α", "β", "γ", "δ", "ε", "φ", " "),
                      stringsAsFactors=FALSE)
    
    mapChars <- function(latin) {
        a <- strsplit(latin, "")[[1]]
        res <- sapply(a, function(x) map$greek[map$latin == x])
        paste(res, sep="", collapse="")
    }
    
    mapChars("abcd")
    ## [1] "αβγδ"
    

    Hope this helps you,

    alex (or άλεξ)