unicode_names

Crates.iounicode_names
lib.rsunicode_names
version0.1.7
sourcesrc
created_at2014-11-14 08:25:07.671462
updated_at2015-12-11 23:59:34.806356
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/huonw/unicode_names
repositoryhttps://github.com/huonw/unicode_names
max_upload_size
id96
size1,642,509
Owners (github:contain-rs:owners)

documentation

http://huonw.github.io/unicode_names/unicode_names/

README

unicode_names

Build Status Coverage Status

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

extern crate unicode_names;

fn main() {
    println!("☃ is called {}", unicode_names::name('☃')); // SNOWMAN
    println!("{} is happy", unicode_names::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: 84

cargo fmt