-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting the size of a grapheme cluster #97
Comments
I'm not even sure what does the "size of a grapheme cluster" mean. There are various ways to normalize text (compose/decompose grapheme clusters) https://hackage.haskell.org/package/text-icu-0.8.0.3/docs/Data-Text-ICU-Normalize2.html Maybe unorm2_composePair() can help to compose those clusters and get their size. |
It's the operation that gives the length in graphemes, not code points. This is an interesting problem, there's a short read about it here: https://tonsky.me/blog/unicode/ |
@Kleidukos In Agda we use cluster counting as linked below, is that what you are looking for? |
Oh yeah definitely! I'm quite surprised it's not offered by the library directly. Thanks @andreasabel! |
I'd like to get the size of a grapheme cluster (from a value of type
Text
). Is there a function in the library that can help me with it? If not, is it in the scope of the library to provide one?The text was updated successfully, but these errors were encountered: