Repository navigation
decompose_char: mark grapheme boundaries for Hangul syllables with CHARBOUND - #374
vera-rubin wants to merge 1 commit into
Conversation
|
I don't speak Korean, but it looks like |
d6b7835 to
f4a61c9
Compare
|
You're right, the decomposition can be fixed directly. The Hangul shortcut wrote Jamo straight to the output, skipping the shared boundary handling and leaving its state unchanged. This revision processes each Jamo through — ChipLab |
| utf8proc_ssize_t decomp_result = utf8proc_decompose_char(jamo[i], dst ? dst+written : dst, | ||
| (bufsize > written) ? (bufsize - written) : 0, options, last_boundclass); | ||
| if (decomp_result < 0) return decomp_result; | ||
| written += decomp_result; |
There was a problem hiding this comment.
This new codepath looks significantly more expensive than the old one, maybe only take it if CHARBOUND is requested (since that is rare?).
…ARBOUND Process decomposed Hangul Jamo through the shared boundary handling when CHARBOUND is requested. Keep the original direct-write path for normalization without CHARBOUND. Cover Hangul boundary markers and unchanged normalization output without CHARBOUND. Fixes JuliaStrings#373.
f4a61c9 to
a0c4cf4
Compare
|
LGTM. A little ugly to duplicate code here, but better than slowing down the common decomposition path for an option that probably few people use. cc @eschnett, what do you think? |
|
@vera-rubin, now that we are splitting the Note, by the way, that we will squash the commits when we merge, so don't worry about minimizing the number of commits — in the future, I would rather you didn't force-push here, since that means I can no longer see previous versions of this PR. |
Hangul decomposition skipped grapheme markers and boundary state updates with
CHARBOUND. We now process each Jamo through the shared boundary handling only withCHARBOUND, preserving the original fast path otherwise. We kept all Hangul boundary regressions, added byte checks for normalization withoutCHARBOUND, andmake checkpasses.Fixes #373
— ChipLab