vbarzokas / greek-utils

A JavaScript library for Greek language with utilities such as replacement of accented and other diacritics characters, conversion from Greek to phonetic, transliterated or greeklish Latin and more.
MIT License
90 stars 7 forks source link

Doesn't covert punctuation and translation isn't quite right #3

Closed ayroblu closed 7 years ago

ayroblu commented 7 years ago

Hey love your work, would like the punctation to change too though:

const greekUtils = require('greek-utils')
const text = greekUtils.toGreeklish('Παρακαλώ;')
console.log(text)

Expected: parakaló? Actual: parakalw;

I had a quick search for this as reference: https://billmounce.com/greekalphabet/greek-punctuation-syllabification as well as google translate

vbarzokas commented 7 years ago

Hi ayroblu, thanks for your feedback.

I am going to add the puncuation mapping of ; to ? to the .toGreeklish method.

Regarding the mapping of ώ to ó and probably other characters (eg. θ το 8), I followed this pattern which is to convert the latin character to the one that is visually similar to the greek one by keeping the orthography of the word, so a native greek (or generally someone who can read greek) can read it seamleslly like it was spelled with greek characters. The term greeklish is properly covered in this article https://en.wikipedia.org/wiki/Greeklish

What you suggest is the phonetic traslate of the greek letters, or as described in this artice the "romanization" of them https://en.wikipedia.org/wiki/Romanization_of_Greek Which is something I believe is very useful and I am going to add it, but in a new separate method because it is a different concept.

ayroblu commented 7 years ago

Okay cool, thanks for the update!