Adding to Arthur s excellent answer, I want to point out that extracting jamo from hangeul syllables is very straightforward from the standard. While the solution isn t specific to Excel or Access (it s a Python module), it only involves arithmetic expressions so it should be easily translated to other languages. The formulas, as can be seen, are identical to those in page 109 of the standard. The decomposition is returned as a tuple of integers encoded strings, which can be easily verified to correspond to the Hangul Jamo Code Chart.
# -*- encoding: utf-8 -*-
SBase = 0xAC00
LBase = 0x1100
VBase = 0x1161
TBase = 0x11A7
SCount = 11172
LCount = 19
VCount = 21
TCount = 28
NCount = VCount * TCount
def decompose(syllable):
global SBase, LBase, VBase, TBase, SCount, LCount, VCount, TCount, NCount
S = ord(syllable)
SIndex = S - SBase
L = LBase + SIndex / NCount
V = VBase + (SIndex % NCount) / TCount
T = TBase + SIndex % TCount
if T == TBase:
result = (L,V)
else:
result = (L,V,T)
return tuple(map(unichr, result))
if __name__ == __main__ :
test_values = u 항가있닭넓짧
for syllable in test_values:
print syllable, : ,
for s in decompose(syllable): print s,
print
This is the output in my console:
항 : ᄒ ᅡ ᆼ
가 : ᄀ ᅡ
있 : ᄋ ᅵ ᆻ
닭 : ᄃ ᅡ ᆰ
넓 : ᄂ ᅥ ᆲ
짧 : ᄍ ᅡ ᆲ