unicode-collation

Crates.iounicode-collation
lib.rsunicode-collation
version0.0.1
sourcesrc
created_at2018-03-19 02:05:33.217948
updated_at2018-03-19 02:05:33.217948
descriptionUnicode collation algorithm according to Technical Standard #10.
homepage
repositoryhttps://github.com/idubrov/unicode-collate
max_upload_size
id56344
size27,759
Ivan Dubrov (idubrov)

documentation

README

crates.io crates.io CircleCI

unicode-collation

A Unicode Collation Algorithm implemented according to Unicode Technical Standard #10.

Usage

Add this to your Cargo.toml:

[dependencies]
unicode-collation = "0.1"

Examples

Generate sort key for the given string:

extern crate unicode_collation;
use unicode_collation::{collate, CollationTable};

let table = CollationTable::from_text_file("data/allkeys.txt");
let key = collate("Hello!!!", &table);
assert_eq!(format!("{:?}", key), "[\
    1D7E 1D10 1DDD 1DDD 1E43 0261 0261 0261 | \
    0020 0020 0020 0020 0020 0020 0020 0020 | \
    0008 0002 0002 0002 0002 0002 0002 0002 |]");

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 0

cargo fmt