unicode-linebreak:Rust Rust中Unicode换行算法的实现

时间:2024-06-13 16:54:24
【文件属性】:

文件名称:unicode-linebreak:Rust Rust中Unicode换行算法的实现

文件大小:137KB

文件格式:ZIP

更新时间:2024-06-13 16:54:24

unicode rust-library line-break Rust

unicode-换行符 描述的行算法的实现。 给定输入文本,找到“换行机会”,或在显示文本时适合换行的位置。 例子 use unicode_linebreak :: {linebreaks, BreakOpportunity :: {Mandatory, Allowed}}; let text = "a b \n c" ; assert! ( linebreaks (text). eq ( vec! [ ( 2 , Allowed), // May break after first space ( 5 , Mandatory), // Must break after line feed ( 6 , Mandatory) // Must break at end of text, so that there always is at least one LB ]));


【文件预览】:
unicode-linebreak-master
----.gitignore(19B)
----src()
--------shared.rs(4KB)
--------lib.rs(5KB)
----LICENSE(11KB)
----LineBreak.txt(234KB)
----Cargo.toml(581B)
----.github()
--------workflows()
----README.md(812B)
----tests()
--------test_default.rs(2KB)
--------LineBreakTest.txt(1.04MB)
----build.rs(18KB)

网友评论