charlenemercury/roster-match

把听到的中文名字对到一份花名册上:按音节比拼音、多音姓、口音归一、字形兜底;拿不准时给候选和理由,不替你下结论。零依赖。

Open original source ↗

From the publisher

README & documentation

Source preview

Read the project’s overview, installation instructions and usage examples. The original README is the source of truth.

把听到的一个中文名字对到一份花名册上,并且在拿不准的时候说自己拿不准。 仓库: · 零依赖 · Node >= 14 有人对着手机说一句「杨林交了,李明没交」,语音识别把名字听成了别的字 —— 「杨凌」被听成「杨林」。要把这句话落到具体的人头上,就得在名单里按读音找人。 这个包只干这一件事,外加一个把整段话按人切开的小工具。 通用库比的是字符串相似度;中文名字要比的是读音,而且读音有自己的结构: 最后两条是这个包和"把拼音拼成字符串再算编辑距离"的主要区别: 它按音节比,并且知道哪些字在姓的位置上换个音。 命中哪一层,返回值里的 kind 就是什么: 判定用的是 kind,不是分数。 你可以通过 scores 调排序,但调不出一个假的 exact。 而且只有前四层(exact / samePinyin / oneLetter / surnameNear)才够格标成 confident。 「名单里只有一个姓李」这种猜测,给它 99 分也还是猜测。这条可以用 reliable 选项调整。 拿不准的时候要老实说拿不准。 匹配错一个人,代价是对方对着一条错记录发愣,而且多半发现不了; 说一句「拿不准,你选一下」,代价只是多点一下。所以这个包宁可多报不确定。 一个具体体现:语音只能挑一种汉字写法。名单里同时有「李明」和「李鸣」时, 识别结果正好写成「李明」不能证明说的就是那个人 —— 所以默认把同音的也摆进 alts。 语音识别经常一个标点都不给。只按标点切的话整句是一段,贪婪匹配会把名字吃成 「杨凌90+30李明」——只出一个人,还对错了人。 规则:数字后面紧跟汉字 = 换了一个人;后面跟的是 + + 加 . 或另一个数字时,说明还在同一个人身上。 全角数字会先归一成半角;名字和数字之间的空格不当分隔(「李明 92」不切开)。 支持:名字 + 阿拉伯数字,人与人之间有标点、空格或直接连读。 不支持,而且会原样留在一段里(不会误切成两个人): 中文数字连读「李明九十分王红八十」、加减分描述「李明90分扣2分」。 这是刻意的 —— 中文数字和业务规则该由上层决定,不该在这里无限追加正则去猜。 (识别 加 扣 减 得 共 总 这几个字,就是为了不把它们当成下一个人的姓。) 这类工具最容易悄悄失效 —— 名字里有个字查不到读音,就匹配不上,而且不报错。 拿你的真实名单在本地跑一遍,缺的字补进 pinyin-table.js 再上线。…

charlenemercury/roster-match on GitHub A short preview, not the full document.

Read the full README ↗ · Preview checked 2026-10-05T12:35:52.238Z

Inside the original README — Document outline
  1. roster-match
  2. 它解决什么问题
  3. 为什么不直接用通用的模糊匹配库
  4. 分层与判定
  5. 该看哪两个字段
  6. 最要紧的一条设计原则
  7. 把一整段话按人切开
  8. 上线前必做:查缺字
  9. 名单的要求
  10. 可调的地方
  11. 要不要再配一个大模型
  12. 选什么模型:别用推理模型

Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.

Documentation belongs to its respective authors. Reported project/model license: AGPL-3.0. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.

What this repository does

把听到的中文名字对到一份花名册上:按音节比拼音、多音姓、口音归一、字形兜底;拿不准时给候选和理由,不替你下结论。零依赖。

Repository facts

Owner
charlenemercury
Primary language
JavaScript
Stars
166
Forks
5
Open issues + pull requests
0
License
AGPL-3.0
Archived
No
Default branch
main
Created
2026-09-28T14:54:47.000Z
Last push
2026-10-03T12:45:07.000Z

Topics and intended use

No topics were included in the latest source metadata.

Review the README for scope, installation, examples and limitations. We do not run repository code or certify it.

Evaluate before installing

Review licensing and dependencies, inspect recent commits and unresolved issues, and test in an isolated environment before production use. Stars and forks alone cannot answer these questions.

README and project files

Issues and maintenance discussion

Releases and changelog

Source and freshness

Source: GitHub. Metadata observed 2026-10-05T12:05:52.305Z. Daily imports are snapshots, not real-time monitoring.

Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.

Open original source

Related repositories

affaan-m/ECC

react/react

trekhleb/javascript-algorithms

Snailclimb/JavaGuide

DietrichGebert/ponytail

airbnb/javascript