7 个稳定版本

2.0.3 2024年5月31日
2.0.2 2024年5月30日
2.0.1 2023年8月18日
1.2.0 2023年8月16日

#804文本处理

Download history · Rust 包仓库 166/week @ 2024-05-03 · Rust 包仓库 138/week @ 2024-05-10 · Rust 包仓库 9/week @ 2024-05-17 · Rust 包仓库 177/week @ 2024-05-24 · Rust 包仓库 391/week @ 2024-05-31 · Rust 包仓库 85/week @ 2024-06-07 · Rust 包仓库 232/week @ 2024-06-14 · Rust 包仓库 194/week @ 2024-06-21 · Rust 包仓库 210/week @ 2024-06-28 · Rust 包仓库 28/week @ 2024-07-05 · Rust 包仓库 69/week @ 2024-07-12 · Rust 包仓库 111/week @ 2024-07-19 · Rust 包仓库 45/week @ 2024-07-26 · Rust 包仓库 139/week @ 2024-08-02 · Rust 包仓库 40/week @ 2024-08-09 · Rust 包仓库 270/week @ 2024-08-16 · Rust 包仓库

494 每月下载量

Apache-2.0

82KB
384

Unicode 语言

该库根据一系列 Unicode 码点检测语言支持。主要用于查找字体支持的语言。

// Input codepoints as a vector of Unicode ranges
let codepoints = vec![[65, 121]];

// Detect languages with a threshold of 0.5
let results = detect(codepoints, 0.5);

// results[0].tag = "en"
// results[1].tag = "nl"
// ...

结果是包含以下签名的 Match 结构体的向量

struct Match {
  // BCP 47 language tag.
  tag: &'static str,
  // English name.
  name: &'static str,
  // Name in native script.
  native: &'static str,
  // Number of codepoints matched.
  count: u32,
  // Score (number of codepoints matched divided by the total).
  score: f64,
}

语言数据来源于 Adobe 字体的 speakeasy 库。数据在构建时提取,并作为库的一部分静态编译。

许可协议

本库采用 Apache-2.0 许可协议。版权所有 2023,The Type Founders

无运行时依赖

~0–1.4MB
~19K SLoC