Grapheme Utils
Handy Robust Utils for Extended Grapheme Clusters
What is this?
Grapheme Utils are a collection of handy utilities to make working with Extended Grapheme Clusters as straight-forward as possible.
Note: Ease of use over Ideomatic Rust
This code will return a "" grapheme or an index past the end of the string instead of None, etc.
I find it much more convenient when working with text to concatenate "" stings more convenient than checking and handling None for example.
You can easily test if a string is None (or len() == 0 when necessary.
Note: This code is a purposefully forgiving.
Many unicode libraries are sensitive to indexed at points not the exact start of a grapheme cluster.
In fact your rust code may well panic instead of returning an error.
This code is very forgiving, and handles any index values that hits any part of a grapheme cluster as though it pointed at the beginning. In other words, this library ignores any issues that would be caused by illegal index references.
Note: Utf-8 Has many very special modes, reverse or downward text for example.
This crate has not been tested with any special unicode modes.
Example Usage
use grapheme-GraphemeUtils;
Features
- Easy to Use: This crate as been designed to be as easy to use as possible.
- Robust and Forgiving: This crate accepts any index value without panicing.
Installation
Add grapheme-utils to your Cargo.toml:
[]
= "0.1.0"
Then, include it in your Rust project:
use *;