All Projects → aui → Pinyin Engine

aui / Pinyin Engine

Licence: mit
JavaScript 拼音匹配引擎

Projects that are alternatives of or similar to Pinyin Engine

mahjong
开源中文分词工具包,中文分词Web API,Lucene中文分词,中英文混合分词
Stars: ✭ 40 (-89.64%)
Mutual labels:  pinyin
pinyin
javascript实现输入汉字获取汉字拼音或者汉字拼音首字母
Stars: ✭ 27 (-93.01%)
Mutual labels:  pinyin
Chinesepinyin Codecompletionhelper
让你的 JetBrains 系 IDE ( IDEA ,PyCharm,PhpStorm,WebStorm,AndroidStudio,DevEco等 )支持中文标识符以拼音输入方式完成代码补全,享受和英文环境一致的中文智能编码体验,为代码表达提供更多选择,一种值得考虑的折中解决方案
Stars: ✭ 262 (-32.12%)
Mutual labels:  pinyin
chinese-rhymer
轻量中文押韵神器,100%绝对可用,傻瓜式命令行操作,秒速实现烈焰单押,闪电双押,龙卷三押以及海啸式四押,目前版本 v0.2.6。Search for rhymes for Chinese words, with 1, 2, 3 and 4 characters, released on PyPI with current version of 0.2.6.
Stars: ✭ 72 (-81.35%)
Mutual labels:  pinyin
syng
A free, open source, cross-platform, Chinese-To-English dictionary for desktops.
Stars: ✭ 108 (-72.02%)
Mutual labels:  pinyin
Pinyin4NET
c# 拼音汉字/姓相互转换工具库 (这只是镜像仓库,源仓库见 https://gitee.com/hyjiacan/Pinyin4Net)
Stars: ✭ 38 (-90.16%)
Mutual labels:  pinyin
langx-java
Java tools, helper, common utilities. A replacement of guava, apache-commons, hutool
Stars: ✭ 50 (-87.05%)
Mutual labels:  pinyin
Neural chinese transliterator
Can CNNs transliterate Pinyin into Chinese characters correctly?
Stars: ✭ 310 (-19.69%)
Mutual labels:  pinyin
hanzi-tools
Converts from Chinese characters to pinyin, between simplified and traditional, and does word segmentation.
Stars: ✭ 69 (-82.12%)
Mutual labels:  pinyin
Phrase Pinyin Data
词语拼音数据
Stars: ✭ 257 (-33.42%)
Mutual labels:  pinyin
pinyin4js
A opensource javascript library for converting chinese to pinyin。welcome Star : P
Stars: ✭ 153 (-60.36%)
Mutual labels:  pinyin
ToolGood.Words.Core
一款高性能敏感词(非法词/脏字)检测过滤组件,附带繁体简体互换,支持全角半角互换,汉字转拼音,模糊搜索等功能。支持.net standard 2.0
Stars: ✭ 66 (-82.9%)
Mutual labels:  pinyin
PHPChineseToPinyin
请移步:
Stars: ✭ 40 (-89.64%)
Mutual labels:  pinyin
pinyin data
🐼 Easy to use and portable pronunciation data for Hanzi characters.
Stars: ✭ 13 (-96.63%)
Mutual labels:  pinyin
Tinypinyin
适用于Java和Android的快速、低内存占用的汉字转拼音库。
Stars: ✭ 3,348 (+767.36%)
Mutual labels:  pinyin
pinyin
an R package for converting Chineses characters into pinyin
Stars: ✭ 45 (-88.34%)
Mutual labels:  pinyin
mw2fcitx
Fcitx 5 pinyin dictionary generator for MediaWiki instances. (Releases for demo dict of zh.moegirl.org.cn)
Stars: ✭ 80 (-79.27%)
Mutual labels:  pinyin
Pinyin
🇨🇳 基于词库的中文转拼音优质解决方案
Stars: ✭ 3,824 (+890.67%)
Mutual labels:  pinyin
Python Pinyin
汉字转拼音(pypinyin)
Stars: ✭ 3,618 (+837.31%)
Mutual labels:  pinyin
rust-pinyin
汉字转拼音
Stars: ✭ 111 (-71.24%)
Mutual labels:  pinyin

pinyin-engine

这是一款简单高效的拼音匹配引擎,它能使用拼音够快速的检索列表中的数据。

  1. 使用索引以及缓存机制,从而在客户端实现毫秒级的数据检索
  2. 它的字典数据格式经过压缩处理,简体中文版本仅仅 17kb 大小(Gzip)
  3. 支持多音字、支持拼音首字母匹配
  4. 简体版本覆盖 6718 个汉字,繁体中文覆盖 20846 个汉字

在线演示:https://aui.github.io/pinyin-engine/example/

安装

npm install pinyin-engine --save

API

new PinyinEngine(list, keys)

建立拼音索引。

参数:

  1. list {[string]|[Object]} 被索引的目标
  2. keys {[string]} 可选。如果 list 为 Object,这里用来设置需要被索引的 key
  3. begin {[boolean]} 可选。如果 begin 为 true,将执行前模糊检索

.query(keyword)

查询匹配拼音的数据。

参数:

  1. keyword {string} 拼音或者关键字

返回:

{[string]|{Object}}

繁体中文版本

包含简体中文与繁体中文。

const PinyinEngine = require('pinyin-engine/tw');

使用范例

列表项为字符串:

const PinyinEngine = require('pinyin-engine');

// 建立数据索引
const pinyinEngine = new PinyinEngine([
    '清华大学',
    '北京大学',
    '中央美院'
]);

// 查询
pinyinEngine.query('daxue'); // ['清华大学', '北京大学']

列表项为对象:

const PinyinEngine = require('pinyin-engine');

// 建立数据索引
const pinyinEngine = new PinyinEngine([
    { id: 0, name: '清华大学' },
    { id: 1, name: '北京大学' },
    { id: 3, name: '中央美院' }
], ['name']);

// 查询
pinyinEngine.query('daxue'); // ['清华大学', '北京大学']
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].