{"id":23719160,"url":"https://github.com/otoneko1102/closewords","last_synced_at":"2025-10-05T10:33:04.667Z","repository":{"id":268478713,"uuid":"897669882","full_name":"otoneko1102/closewords","owner":"otoneko1102","description":"A library for finding the most similar word from a list of words, supporting Japanese (including kanji). / 最も似た単語を単語群から検索する日本語(漢字含む)対応のライブラリ","archived":false,"fork":false,"pushed_at":"2024-12-27T08:54:39.000Z","size":15094,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T08:55:11.498Z","etag":null,"topics":["close","closeword","japan","japanese","jp","nodejs","npm","package","search","word"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/closewords","language":"JavaScript","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/otoneko1102.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T03:05:30.000Z","updated_at":"2024-12-27T08:54:42.000Z","dependencies_parsed_at":"2024-12-17T02:46:11.594Z","dependency_job_id":"0a798adc-247d-4531-a689-79ee7a570324","html_url":"https://github.com/otoneko1102/closewords","commit_stats":null,"previous_names":["otoneko1102/closewords","otoneko1102/closeword"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoneko1102%2Fclosewords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoneko1102%2Fclosewords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoneko1102%2Fclosewords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoneko1102%2Fclosewords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otoneko1102","download_url":"https://codeload.github.com/otoneko1102/closewords/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231918572,"owners_count":18445746,"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":["close","closeword","japan","japanese","jp","nodejs","npm","package","search","word"],"created_at":"2024-12-30T21:47:05.249Z","updated_at":"2025-10-05T10:32:59.625Z","avatar_url":"https://github.com/otoneko1102.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# closewords\nA library for finding the most similar word from a list of words, supporting Japanese (including kanji).  \n最も似た単語を単語群から検索する日本語(漢字含む)対応のライブラリ\n\n\u003e Note: it may be a little slow because it uses morphological analysis. By adopting `worker_threads`, the processing speed is slightly improved compared to the standard.  \n\u003e 注意: 形態素解析を利用しているため多少遅い可能性があります。`worker_threads` を採用しているため、標準より少しは処理速度は改善されています。\n\n## Usage\n##### **closeWords(word: string | { word: string, pronounce?: string }, candidates: Array\\\u003cstring | { word: string, pronounce?: string }\\\u003e, raw?:boolean(default: false)): Promise\\\u003cstring[] | Array\\\u003c{ word: string, score: number }\\\u003e\\\u003e**\nThe highest score is 1 (the lowest is 0).  \nA score of 1 means a perfect character-by-character match.  \nスコアの最高値は1です(最低値は0です)。  \nスコアが1の場合、文字列が完全に一致していることを示します。\n\n### Example\n```js\nconst { closeWords } = require('closewords');\n\n(async () =\u003e {\n  const word = '東京';\n  const candidates = ['東京', 'とっこう', '東きょう', 'とう京', 'とうきょう', 'とーきょー'];\n\n  try {\n    const result = await closeWords(word, candidates);\n    console.log('結果:', result);\n\n    // raw: true\n    const resultWithScores = await closeWords(word, candidates, true);\n    console.log('スコアを含む結果:', resultWithScores);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n})();\n```\n\n### Result\n```\n結果: [ '東京' ]\nスコアを含む結果: [\n  { word: '東京', score: 1 },\n  { word: 'とう京', score: 0.6933333333333332 },\n  { word: 'とうきょう', score: 0.48999999999999994 },\n  { word: '東きょう', score: 0.468560606060606 },\n  { word: 'とっこう', score: 0.4308888888888888 },\n  { word: 'とーきょー', score: 0.41533333333333333 }\n]\n```\n\n## Change Log\n### 2.2.0 --\u003e 2.3.0\nImproved Hepburn-style completion.  \nFormat code.  \nヘボン式補完を改善しました。  \nコードをフォーマットしました。\n### 2.1.4 --\u003e 2.2.0\n`word.pronounce` and `pronounce` in `candidates[]` are completed Hepburn-style.\n`word.pronounce` と `candidates[]` 内の `pronounce` をヘボン式で補完するようにしました。\n### 2.1.3 --\u003e 2.1.4\nFixed bugs.  \nバグを修正しました。\n### 2.1.2 --\u003e 2.1.3\nFixed score calculation.  \nスコア計算方法を修正しました。\n### 2.1.1 --\u003e 2.1.2\nFixed score calculation.  \nスコア計算方法を修正しました。\n### 2.1.0 --\u003e 2.1.1\nFixed `README`.  \nFixed the issue that only a string could be specified in `word`.  \nFixed the issue that `word.pronounce` was ignored.  \nFixed the issue that non-alphabet could be specified for `word.pronounce` and `pronounce` in `candidates[]`.  \n`word.pronounce` and `pronounce` in `candidates[]` are now optional.  \nFixed a few pther bugs.  \n`README` を修正しました。  \n`word` に文字列以外指定できない問題を修正しました。  \n`word.pronounce` が無視される問題を修正しました。  \n`word.pronounce` と `candidates[]` 内の `pronounce` にアルファベット以外を指定できる問題を修正しました。  \n`word.pronounce` と `candidates[]` 内の `pronounce` を任意にしました。  \nその他数件のバグを修正しました。\n### 2.0.0 --\u003e 2.1.0\nAdded a way to specify the pronunciation of words.  \n単語の発音を指定する方法を追加しました。\n### 1.0.2 --\u003e 2.0.0\nIntroduced `fast-levenshtein` and fixed score calculation. The similarity of the original strings is also evaluated.  \n`fast-levenshtein` を導入し、スコア計算方法を修正しました。元の文字列の一致度も評価されるようになりました。\n### 1.0.1 --\u003e 1.0.2\nIntroduced `jaro-winkler` and optimized.  \n`jaro-winkler` を導入し、最適化しました。\n### 1.0.0 --\u003e 1.0.1\nFixed score calculation.  \nスコア計算方法を修正しました。\n### 0.x --\u003e 1.0.0\nPackage released! Introducing morphological analysis.  \nパッケージをリリース！ 形態素解析を導入しました。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotoneko1102%2Fclosewords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotoneko1102%2Fclosewords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotoneko1102%2Fclosewords/lists"}