unicode_names2

Crates.iounicode_names2
lib.rsunicode_names2
version1.3.0
sourcesrc
created_at2018-06-17 00:17:57.518304
updated_at2024-09-12 17:14:05.200863
descriptionMap characters to and from their name given in the Unicode standard. This goes to great lengths to be as efficient as possible in both time and space, with the full bidirectional tables weighing barely 500 KB but still offering O(1)* look-up in both directions. (*more precisely, O(length of name).)
homepagehttps://github.com/progval/unicode_names2
repositoryhttps://github.com/progval/unicode_names2
max_upload_size
id70420
size2,269,004
Val Lorentz (progval)

documentation

https://docs.rs/unicode_names2/

README

unicode_names2

Build Status

Time and memory efficiently mapping characters to and from their Unicode 16.0 names, at runtime and compile-time.

fn main() {
    println!("☃ is called {}", unicode_names2::name('☃')); // SNOWMAN
    println!("{} is happy", unicode_names2::character("white smiling face")); // ☺
    // (NB. case insensitivity)
}

The maps are compressed using similar tricks to Python's unicodedata module, although those here are about 70KB (12%) smaller.

Documentation

Commit count: 152

cargo fmt