unicode-math-class 0.1.0

Determine the Unicode class of a mathematical character.
Documentation
  • Coverage
  • 21.05%
    4 out of 19 items documented1 out of 3 items with examples
  • Size
  • Source code size: 94.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.45 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • typst/unicode-math-class
    12 7 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • laurmaedje

unicode-math-class

Crates.io Documentation

Determine the Unicode class of a mathematical character in Rust.

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

Example

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);

For more details, see Section 5.1 of Unicode Technical Report #25 and this data file.

License

This crate is dual-licensed under the MIT and Apache 2.0 licenses.