{"id":18722006,"url":"https://github.com/realign/pinyin-so","last_synced_at":"2025-11-11T04:30:15.949Z","repository":{"id":57324521,"uuid":"261004505","full_name":"ReAlign/pinyin-so","owner":"ReAlign","description":"🀄️🔍 拼音搜索方案，支持 全拼/简拼/同音字 等。","archived":false,"fork":false,"pushed_at":"2020-07-13T22:54:20.000Z","size":814,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T15:03:29.035Z","etag":null,"topics":["chinese","pinyin","search","so"],"latest_commit_sha":null,"homepage":"https://realign.github.io/pinyin-so/code/demo/build/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ReAlign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-03T19:24:43.000Z","updated_at":"2021-07-17T15:43:51.000Z","dependencies_parsed_at":"2022-09-21T01:11:41.940Z","dependency_job_id":null,"html_url":"https://github.com/ReAlign/pinyin-so","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Fpinyin-so","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Fpinyin-so/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Fpinyin-so/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Fpinyin-so/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReAlign","download_url":"https://codeload.github.com/ReAlign/pinyin-so/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239587243,"owners_count":19663892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chinese","pinyin","search","so"],"created_at":"2024-11-07T13:39:17.874Z","updated_at":"2025-11-11T04:30:15.883Z","avatar_url":"https://github.com/ReAlign.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pinyin-so\n\n⚠️⚠️⚠️ 目前为非稳定版本\n\n[![NPM version][npm-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/pinyin-so.svg?longCache=true\u0026style=for-the-badge\n[npm-url]: https://www.npmjs.com/package/pinyin-so\n\n\u003e 拼音搜索方案，支持 全拼/简拼/同音字 等。\n\n![image/normal/2020-05-18/img-1589737460574-6747.png](https://public-bucket-realign.nos-eastchina1.126.net/image/normal/2020-05-18/img-1589737460574-6747.png)\n\n## Demo\n\n\u003e by some framework as:\n\n* [svelte-js-app](https://realign.github.io/pinyin-so/code/demo-svelte/build)\n* [react-ts-app](https://realign.github.io/pinyin-so/code/demo-ts-react/build)\n* [vue-ts-app](https://realign.github.io/pinyin-so/code/demo-ts-vue/build)\n\n## Usage\n\n```js\nimport PinyinSo from 'pinyin-so';\n\n/**\n * @name    PinyinSo.so\n * @param   {String}    targetStr   待搜索文本\n * @param   {String}    keyword     搜索关键词\n * @returns {Boolean | Array}       失败结果 或者 结果索引\n */\nconst res = PinyinSo.so(`${targetStr}`, `${keyword}`);\nif(res) {\n  const [start, end] = res;\n} else {\n  console.log('No matching results.');\n}\n```\n\n## 待办\n\n* [ ] 优化代码\n* [ ] 发新版\n\n## 参考|感谢\n\n* [xmflswood/pinyin-match](https://github.com/xmflswood/pinyin-match)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealign%2Fpinyin-so","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealign%2Fpinyin-so","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealign%2Fpinyin-so/lists"}