Documentation
Usage
disassembleToGroups

disassembleToGroups

Completely separate a Hangul string into individual characters based on the initial consonant, medial vowel, and final consonant.

Complex consonants like are split into ['ㄴ', 'ㅈ'], and complex vowels like are split into ['ㅗ', 'ㅏ'].

For detailed examples, please refer to the section below.

function disassembleToGroups(
  // The Korean string to be disassembled
  str: string
): string[][];

Examples

disassembleToGroups('사과'); // [['ㅅ', 'ㅏ'], ['ㄱ', 'ㅗ', 'ㅏ']]
disassembleToGroups('ㅘ'); // [['ㅗ', 'ㅏ']]
disassembleToGroups('ㄵ'); // [['ㄴ', 'ㅈ']]

Demo