Skip to content

A Rust library that helps sort a string vector by Pinyin. Rust 字符串向量按拼音排序

License

Notifications You must be signed in to change notification settings

iovxw/pinyin-order

Repository files navigation

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.

About

A Rust library that helps sort a string vector by Pinyin. Rust 字符串向量按拼音排序

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages