#class #unicode #character #determine #math-class

unicode-math-class

通过以下方式确定数学字符的Unicode类别:

1 个不稳定版本

0.1.0 2023年3月27日

数学类别中排名第667

Download history 1973/week @ 2024-03-14 1218/week @ 2024-03-21 989/week @ 2024-03-28 885/week @ 2024-04-04 860/week @ 2024-04-11 702/week @ 2024-04-18 817/week @ 2024-04-25 817/week @ 2024-05-02 858/week @ 2024-05-09 1611/week @ 2024-05-16 1195/week @ 2024-05-23 884/week @ 2024-05-30 1248/week @ 2024-06-06 1077/week @ 2024-06-13 1194/week @ 2024-06-20 840/week @ 2024-06-27

每月下载量4,470
29个crate中使用(其中2个直接使用)

MIT/Apache

85KB
3K SLoC

unicode-math-class

Crates.io Documentation

在Rust中确定数学字符的Unicode类别。

[dependencies]
unicode-math-class = "0.1"

示例

use unicode_math_class::{class, MathClass};

assert_eq!(class('0'), Some(MathClass::Normal));
assert_eq!(class('a'), Some(MathClass::Alphabetic));
assert_eq!(class('𝔸'), Some(MathClass::Alphabetic));
assert_eq!(class('+'), Some(MathClass::Vary));
assert_eq!(class('×'), Some(MathClass::Binary));
assert_eq!(class('('), Some(MathClass::Opening));
assert_eq!(class(','), Some(MathClass::Punctuation));
assert_eq!(class('|'), Some(MathClass::Fence));
assert_eq!(class('😃'), None);

更多详细信息,请参阅Unicode技术报告#25的第5.1节此数据文件

许可证

此crate根据MIT和Apache 2.0许可证双重授权。

无运行时依赖