Open sinbino opened 8 months ago
@sindresorhus FWIW with my approach of stripping \p{M}
characters these test cases seem to pass instead.
It's interesting actually because if Intl.Segmenter
is the best way to do this, and Intl.Segmenter
sees that as a single segment, what else is missing that would allow us to account for this use case correctly? And once we know what the other missing ingredients are what useful thing is Intl.Segmenter
actually doing for us here? 🤔
Like from this example it seems like we don't actually care about "graphemes", and that seems the most granular thing that Intl.Segmenter
can segment.
Japanese half-width kana dakuten(゙) and han-dakuten(゚) are not counted.
Since dakuten(゙) and han-dakuten(゚) actually have width, these results should be 2.