JJamoWren
Workflows

Coding workflows · Hangul syllable decomposition

03
Built around your work

A concrete starting point

Decompose one precomposed modern Hangul syllable into its leading, vowel and optional trailing jamo. Test syllables with and without a tail and both range endpoints, rejecting other characters rather than claiming general Unicode normalization.

01

Open the context

Choose the project folder and name the files or behavior involved.

02

Define the change

Describe the input, expected output and boundaries that must stay intact.

03

Inspect the work

Review the proposed edits and any commands before relying on their result.

04

Check the outcome

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

Hangul syllable decomposition

A concrete starting point
def hangul_jamo(syllable):
    if type(syllable) is not str or len(syllable) != 1 or not 0xAC00 <= ord(syllable) <= 0xD7A3:
        raise ValueError("hangul.syllable")
    index = ord(syllable) - 0xAC00
    lead = chr(0x1100 + index // 588)
    vowel = chr(0x1161 + (index % 588) // 28)
    tail = index % 28
    return lead + vowel + (chr(0x11A7 + tail) if tail else "")

The example is a starting point for a real project, not a claim that generated code is already tested. Adjust paths, dependencies and expected behavior to match your application.

AI coding workspace

Your next change starts here.

Get the Windows app ↗