[Haskell-cafe] Grapheme length?
Viktor Dukhovni
ietf-dane at dukhovni.org
Sat Feb 20 08:12:58 UTC 2021
> On Feb 20, 2021, at 5:56 AM, Viktor Dukhovni <ietf-dane at dukhovni.org> wrote:
>
> But in fact, exactly some of the new code points are relevant for detection
> of grapheme cluster boundaries (your algorithm looks too naïve) see:
More importantly, the ICU documentation does not recommend working with the
underlying low-level properties and rules. Rather the suggested way to
traverse a string one grapheme at a time is to use a BreakIterator:
https://unicode-org.github.io/icu/userguide/boundaryanalysis/#character-boundary
Fortunately, these are also supported:
https://hackage.haskell.org/package/text-icu-0.7.0.1/docs/Data-Text-ICU-Break.html#g:2
So my referral to the "Char" module probably led you astray. Sorry about that...
--
Viktor.
More information about the Haskell-Cafe
mailing list