5 releases (3 breaking)

0.3.0 Oct 25, 2020
0.2.1 Jun 19, 2020
0.2.0 Jun 29, 2019
0.1.0 Jan 9, 2017
0.0.1 Apr 29, 2016

#138 in Text processing

Download history 26606/week @ 2024-08-15 36070/week @ 2024-08-22 28839/week @ 2024-08-29 30882/week @ 2024-09-05 22706/week @ 2024-09-12 28147/week @ 2024-09-19 36049/week @ 2024-09-26 24101/week @ 2024-10-03 27270/week @ 2024-10-10 29139/week @ 2024-10-17 22676/week @ 2024-10-24 25177/week @ 2024-10-31 19050/week @ 2024-11-07 57846/week @ 2024-11-14 24830/week @ 2024-11-21 22973/week @ 2024-11-28

127,667 downloads per month
Used in 633 crates (19 directly)

Apache-2.0

175KB
2.5K SLoC

Rust 2K SLoC // 0.1% comments Python 261 SLoC // 0.3% comments C++ 112 SLoC // 0.1% comments

xi-unicode

This crate contains unicode utilites adapted for working with non-contiguous bytes (such as a rope.)

Much of the contents of this repo are generated automatically by scripts from Unicode data files.

This current file is the result of some archaeology; documentation on how to rebuild the various files was missing, and I am attempting to reconstruct it.

data

Constructing the various tables require the various data files. These are available through the components of the Unicode standard directory, for a given unicode version. In particular, we require LineBreak.txt.

This file should be placed in a directory: I use data.

  • src/tables.rs is generated with the script located at tools/mk_tables.py, and can be built with,

    $ python3 tools/mk_tables.py data > src/tables.rs
    

    where data is the path to the created data directory.

  • the unit tests in src/lib.rs are also generated by this script, by passing the --tests and --tests-str flags (separately, to separate invocations) of the script, and then copying the output over into the body of these tests.

No runtime deps