#segmentation

unicode_extension

Extension of the Unicode Segmentation crate allowing you to use a list of clusters as if they were a String

3 releases (breaking)

0.3.0 Aug 11, 2024
0.2.0 Aug 5, 2024
0.1.0 Aug 4, 2024

#118 in Internationalization (i18n)

Download history 214/week @ 2024-08-04 117/week @ 2024-08-11 4/week @ 2024-08-18 20/week @ 2024-09-15 23/week @ 2024-09-22 26/week @ 2024-09-29 1/week @ 2024-10-06

100 downloads per month

Custom license

6KB
67 lines

Stability

This crate is not stable at all. Use at your own risk.

Clusters

Clusters are the main component of this crate. They act similarly to String, with the main difference being the index/iteration processes going over grapheme clusters, instead of char.

Why this crate

This crate stems from the need to have easy to use structures, similar to String, but with the grapheme clusters as its element. For example, it means that this is now trivial:

		import unicode_extension::Clusters;
        let s = "Étiré";
		let c = Clusters::new(s, true)
        let expected_clusters = Clusters(vec!["É", "t", "i", "r", "é"]);
        assert_eq!(c, expected_clusters);

Goals

Have a similar api to std::string::String.

Dependencies

~355KB