12
1
Yes, It's basically You're a Romanizer, Baby, but harder. like, way harder.
Learning Korean is HARD. at least for a person outside Asia. But they at least have the chance to learn, right?
What you must do
You will be given a Korean Statement. For example, 안녕하세요
. You must convert the input to its Roman pronunciation. For the given example, the output can be annyeonghaseyo
.
Now it gets technical
A Korean character has three parts, Starting consonant, Vowel, and Ending consonant. The Ending consonant may not exist in the character.
For example, 아
is ㅇ
(Starting consonant) and ㅏ
(Vowel), and 손
is ㅅ
(Starting consonant), ㅗ
(Vowel), and ㄴ
(Ending consonant).
Evert consonant and vowel has its pronunciation. The pronunciation for each consonant is as following.
Korean ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ
Romanization Starting g kk n d tt r m b pp s ss – j jj ch k t p h
Ending k k n t – l m p – t t ng t – t k t p h
( - means no pronunciation or not used. you do not have to handle them.)
and Pronunciation for each vowels is as following.
Hangul ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅛ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ
Romanization a ae ya yae eo e yeo ye o wa wae oe yo u wo we wi yu eu ui i
Now its the real hard part
The consonant's pronunciation changes by the Ending consonant in before. The pronunciation for every Starting/Ending consonant is as the following image.
(You do not have to do the hyphen between pronunciations. Its unnecessary. If a cell has two or more pronunciations, choose one. If there's no ending consonant, use the original pronunciation.)
Examples
Korean => English
안녕하세요 => annyeonghaseyo
나랏말싸미 듕귁에달아 => naranmalssami dyunggwigedara //See how the ㅅ in 랏 changes from 't' to 'n'
Example suggestion welcomed. You can get answers for your own inputs here. (The one in "General text", Revised is what I'm asking for)
Will the input always consist of Unicode characters AC00-D7AF + space? – Arnauld – 2018-02-10T09:53:26.593
1There are several special ㅎ + X combinations which are not highlighted in yellow (e.g. ㅎ+ ㅈ = ch). Does that mean that we don't have to support them? (Also, ㅎ is 'romanized' as t instead of h in the picture, which is a bit confusing.) – Arnauld – 2018-02-10T10:33:24.940
1
Test cases: https://gist.github.com/perey/563282f8d62c2292d11aabcde0b94d2d As @Arnauld says, there are some oddities in the special combinations; this has tests for all of the ones I found in the table, whether highlighted or not. Where multiple options exist, they are space-separated. No hyphens are used as I expect people to golf them out.
– Tim Pederick – 2018-02-10T11:47:11.7301I don't see "General text" in your suggested output-checking link; do you mean "General things"? If so, which one of the three should we use (Revised, McCune, Yale)? None seem to match your table; for example, ㅈ followed by ㄹ should be "nn" according to you but is "tr" or "cl" at that link. (Note that my test cases in the previous comment are based on transliterations in the question!) – Tim Pederick – 2018-02-10T11:57:23.270
ㅎ
followed byㄱ, ㄷ, ㅈ
are also special cases (they become aspirated toㅋ, ㅌ, ㅈ
(k, t, j) ) should highlight those too. – JungHwan Min – 2018-02-10T17:03:53.733As a Korean myself, I like to see Korean-related challenges. But it's kinda sad that double final consonants aren't considered in this challenge... – JungHwan Min – 2018-02-10T17:06:36.313
@JungHwanMin I could (As I am a Korean myself too), but that would only complicate things more. :P – Matthew Roh – 2018-02-10T18:05:52.053
@JungHwanMin Also It's already highlighted in the image. – Matthew Roh – 2018-02-12T03:37:47.020
@lol doesn't seem like it: (for instance ㅎ then ㄱ makes
k
, but that's not highlighted) – JungHwan Min – 2018-02-12T19:05:20.617