Library inspired by https://github.com/mattn/go-runewidth and https://github.com/rivo/uniseg to handle the width and segmenting of Unicode runes and graphemes
Vivianne Langdon
31012d5b8f
- We change the stream iterator to *always* return a grapheme (except for EOF). The grapheme then gets built up over time. - This way, trans flag for example is first white flag, then white flag + zwj, etc until it finally transforms into the trans flag. - Users of the stream library can then use the `modification?' flag to determine if the stream value is a modification of the prior grapheme instead of a new grapheme. - Abstracted iteration to an iterator object to support use cases where we don't have an input stream (reflow needs this!) |
||
---|---|---|
doc | ||
scripts | ||
tests | ||
uniseg | ||
.gitignore | ||
COPYING | ||
guix.scm | ||
HACKING | ||
hall.scm | ||
README | ||
README.org | ||
uniseg.scm |
README for Guile Uniseg
guile-uniseg
is a simple Guile library that provides several new Guile character sets for categorizing
East Asian characters and emoji. This can be useful when determining the width of characters.
This library is heavily inspired by the golang libraries uniseg
and uniseg
.
Scripts
There are two scripts which can be used to regenerate the character set files. These are optional to run, since
the script's output is stored in the repository at uniseg/eastasian.scm
and uniseg/emoji.scm
.
However, should the source change as the unicode spec changes, these can be refreshed.