seshat-unicode 0.0.11

A Unicode Library for Rust.
Documentation

Seshat 𓋇𓏏𓁐

crates.io

logo

A Unicode Library for Rust.

Demo

! This demo is using C++ version of Seshat. Seshat Web Demo

Introduction

Seshat (pronounce as Sehs-hat) is a Unicode library that written in Rust. It provides many of Unicode character data and standard algorithms. The goal of this project is to provide a ICU-like library in Rust.

Version

Seshat follows the latest version of Unicode. Currently using version 13.0.0.

Usage

[dependencies]
seshat-unicode = "0.0.11"
use seshat::unicode::Ucd;

fn main() {
    println!("πŸ¦€ is {}!", 'πŸ¦€'.na());
}

Features

Grapheme cluster break

use seshat::unicode::Segmentation;

fn main() {
    let s = "Hi, πŸ‘¨πŸΎβ€πŸ€β€πŸ‘¨πŸΏ";
    for seg in s.break_graphemes() {
        println!("{}", seg);
    }
}

This will prints

$ cargo run
H
i
,
 
πŸ‘¨πŸΎβ€πŸ€β€πŸ‘¨πŸΏ

Normalization

use seshat::unicode::Normalization;

fn main() {
    let s1 = "Γ…";
    println!("{:?}", s1.to_nfd()); // Will prints "A\u{30a}"

    let s2 = "γŒ€";
    println!("{}", s2.to_nfkd()); // Will prints γ‚’γƒγ‚šγƒΌγƒˆ

    let s3 = "e\u{0301}";
    println!("{}", s3.to_nfc()); // Will prints Γ©
}

Contribute

Add later.

License

All logo images are copyright Frybits Inc. and should not be used out of this project without permission.

Seshat is developed under MIT License. For the detail, see the LICENSE file.