Is there a way in javascript to split a word such as
"팔꿈"
into an array
[ㅍ,ㅏ,ㄹ,ㄱ,ㄱ,ㅜ,ㅁ]
?
I'm trying to check for correct inputs for a word rather than the whole word itself.
this package has helped https://github.com/e-/Hangul.js
Is there a way in javascript to split a word such as
"팔꿈"
into an array
[ㅍ,ㅏ,ㄹ,ㄱ,ㄱ,ㅜ,ㅁ]
?
I'm trying to check for correct inputs for a word rather than the whole word itself.
this package has helped https://github.com/e-/Hangul.js
Not exactly, but close enough, by using normalization form D (NFD), i.e. canonical decomposition:
console.log(Array.from("팔꿈".normalize ('NFD'))); // returns ['ᄑ', 'ᅡ', 'ᆯ', 'ᄁ', 'ᅮ', 'ᆷ']