hangul-utils
A Clojure library for manipulating Korean characters and alphabets.
Usage
This library represents a deconstructed Korean syllable as a vector of letters (or jamo).
(deconstruct \μ)
;; => [\γ
\γ
\γ΄]
(deconstruct-str "μλ
νμΈμ")
;; => [[\γ
\γ
\γ΄] [\γ΄ \γ
\γ
] [\γ
\γ
] [\γ
\γ
] [\γ
\γ
]]
(construct [\γ
\γ
])
;; => \ν
(construct-str [[\γ
\γ
‘ \γΉ] [\γΉ \γ
] [\γ
\γ
] [\space] [\γ
\γ
] [\γ
\γ
£ \γ
] [\γ΄ \γ
] [\γ
\γ
]])
;; => "ν΄λ‘μ Έ μ¬λ°λ€μ"
You can also transform strings end-to-end:
(alphabetize "μ€λλΆν°..!")
;; => "γ
γ
γ΄γ
‘γΉγ
γ
γ
γ
..!"
(syllabize "γΉγ
£γ
γ
£γ
γ
£γ
γ
£γ΄γ
£γ
γ±γ
γ
γ
γ
γ
γ
‘γ
γ΄γ
£γ·γ
")
;; => "리μΉνν€λ κ³ λ§μ΅λλ€"
Thanks
Thanks to kaniblu for the Python hangul-utils library, which inspired this.
License
Copyright Β© 2017 Sooheon Kim
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.