Hacker Timesnew | past | comments | ask | show | jobs | submitlogin
Coloring Korean Keystrokes: 11'172 Characters (sam.today)
5 points by samtoday on Sept 7, 2024 | hide | past | favorite | 1 comment


Hangul syllable composition is systematic enough that you could have just used some thresholding and flood fill instead. There are only 9 distinct layouts [1] possible after all, all of which can be determined via a simple decision tree, so you collect syllables for each layout and determine the optimal horizontal or vertical line to split them. That alone wouldn't fully segment, say, 고 where a bounding box for ㄱ typically overlaps with that for ㅗ, but you can then assume that no path doesn't belong to multiple segments (which is true for most non-novelty fonts). You can also add more branches to your decision tree if your font is too atypical to be cleanly segmented.

[1] https://en.wikipedia.org/wiki/Hangul#Letter_placement_within...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: