ib-pinyin

Crates.ioib-pinyin
lib.rsib-pinyin
version0.3.1
created_at2023-12-16 17:20:32.738569+00
updated_at2025-08-21 12:45:03.443318+00
description一个高性能拼音查询、匹配库
homepagehttps://github.com/Chaoses-Ib/ib-matcher
repositoryhttps://github.com/Chaoses-Ib/ib-matcher
max_upload_size
id1071880
size36,503
(Chaoses-Ib)

documentation

README

ib-pinyin

crates.io Documentation License

一个高性能 Rust 拼音查询、匹配库。

  • 支持以下拼音编码方案:
    • 简拼(“py”)
    • 全拼(“pinyin”)
    • 带声调全拼(“pin1yin1”)
    • Unicode(“pīnyīn”)
    • 智能 ABC 双拼
    • 拼音加加双拼
    • 微软双拼
    • 华宇双拼(紫光双拼)
    • 小鹤双拼
    • 自然码双拼
  • 支持多音字。
  • 支持混合匹配多种拼音编码方案,默认匹配简拼和全拼。
  • 默认小写字母匹配拼音或字母,大写字母只匹配字母。
  • 支持 Unicode 辅助平面汉字。

支持 C、AHK2。

Usage

use ib_pinyin::{matcher::PinyinMatcher, pinyin::PinyinNotation};

let matcher = PinyinMatcher::builder("pysousuoeve")
    .pinyin_notations(PinyinNotation::Ascii | PinyinNotation::AsciiFirstLetter)
    .build();
assert!(matcher.is_match("拼音搜索Everything"));

Testing

cargo hack test --feature-powerset
Commit count: 164

cargo fmt