#sorting #chinese #numbers #optional #collate #vec-str #這個crate可以協助用戶在rust專案中更方便的進行中文排序。

sort_zh

Provide the functionality to sort Vec<&str> with Chinese collate, with optional Chinese number sort functionality

2 releases

0.1.1 Jan 3, 2023
0.1.0 Jan 3, 2023

#78 in #optional

Download history 15/week @ 2024-02-26 7/week @ 2024-03-11 31/week @ 2024-03-18

53 downloads per month

MIT license

1MB
291 lines

sort_zh

這個crate可以協助用戶在Rust專案中更方便的進行中文排序。

在Rust中,如果直接使用 sort() 系列function進行Vec的排序,非ASCII部分的文字會因為Unicode Hex Code的排序而混亂。

本crate提供了 sort_zh() function 進行正確的排序(預設透過筆畫順序),用戶也可以利用 SortZhOptions 中的設定進行自定義排序。

內附單元測試,可透過 cargo test 進行測試。


lib.rs:

這個crate可以協助用戶在Rust專案中更方便的進行中文排序。

在Rust中,如果直接使用sort()系列function進行Vec的排序,非ASCII部分的文字會因為Unicode Hex Code的排序而混亂。

本crate提供了sort_zh() function 進行正確的排序(預設透過筆畫順序),用戶也可以利用SortZhOptions中的設定進行自定義排序。

Dependencies