pinyin-order

Crates.iopinyin-order
lib.rspinyin-order
version0.1.2
sourcesrc
created_at2017-03-10 14:07:22.977079
updated_at2020-11-13 08:52:02.516275
descriptionA Rust library that helps sort a string vector by Pinyin. Rust 字符串向量按拼音排序
homepagehttps://github.com/iovxw/pinyin-order
repositoryhttps://github.com/iovxw/pinyin-order
max_upload_size
id8919
size930,345
iovxw (iovxw)

documentation

https://docs.rs/pinyin-order

README

Deprecated: The pinyin crate has been rewritten, use it instead.

pinyin-order

Travis Build Status Crates Documentation

Rust 字符串向量按拼音排序

Example

extern crate pinyin_order;

use pinyin_order::as_pinyin;

fn main() {
    let mut l = vec!["中文", "中国", "abc", "重工", "abc中文"];
    l.sort_by_key(|s| as_pinyin(s));
    assert_eq!(l, vec!["abc", "abc中文", "中国", "中文", "重工"]);
}

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

Commit count: 9

cargo fmt