{"id":13776405,"url":"https://github.com/9beach/hanspell","last_synced_at":"2025-04-06T22:09:49.324Z","repository":{"id":32820828,"uuid":"143580211","full_name":"9beach/hanspell","owner":"9beach","description":"(주)다음과 부산대학교 인공지능연구실/(주)나라인포테크의 웹 서비스를 이용한 한글 맞춤법 검사기.","archived":false,"fork":false,"pushed_at":"2023-04-12T10:02:18.000Z","size":1645,"stargazers_count":140,"open_issues_count":4,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-14T08:02:02.061Z","etag":null,"topics":["hangeul","hangul","korean","nodejs","spellcheck"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9beach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-05T03:27:06.000Z","updated_at":"2024-02-28T23:12:48.000Z","dependencies_parsed_at":"2024-01-13T11:13:50.491Z","dependency_job_id":"cbed7598-38fe-4119-aae5-a7ad2fc3b042","html_url":"https://github.com/9beach/hanspell","commit_stats":{"total_commits":152,"total_committers":6,"mean_commits":"25.333333333333332","dds":0.03947368421052633,"last_synced_commit":"211738eac9c8a01e09549a24051ab740ecce160b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fhanspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fhanspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fhanspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fhanspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9beach","download_url":"https://codeload.github.com/9beach/hanspell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["hangeul","hangul","korean","nodejs","spellcheck"],"created_at":"2024-08-03T18:00:24.909Z","updated_at":"2025-04-06T22:09:49.292Z","avatar_url":"https://github.com/9beach.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Programming Languages"],"sub_categories":["JavaScript"],"readme":"# hanspell\n\n`hanspell`은 (주)다음과 부산대학교 인공지능연구실/(주)나라인포테크의 웹 서비스를 이용한 한글 맞춤법 검사기입니다.\n\n[비주얼 스튜디오 코드 한스펠](https://github.com/9beach/vscode-hanspell)과 [하스켈](https://www.haskell.org/)로 작성한 [hanspell-hs](https://github.com/9beach/hanspell-hs)도 있으니 참고하세요.\n\n[![npm version](https://badge.fury.io/js/hanspell.svg)](https://badge.fury.io/js/hanspell)\n\n## 설치\n\n[한스펠 릴리스](https://github.com/9beach/hanspell/releases)에서 실행파일을 다운로드 하세요.\n\n소스를 받아서 설치하려면 [Node.js](https://nodejs.org/ko/)를 설치한 뒤 다음을 실행하세요.\n\n```sh\nnpm install -g hanspell\n```\n\nNode.js 환경에 따라 `sudo` 명령이 필요할 수도 있습니다.\n\n```sh\nsudo npm install -g hanspell\n```\n\n## 명령어 사용법\n\n```console\n$ hanspell-cli -h\n사용법: hanspell-cli [-d | -p | -a | -h]\n\n옵션:\n  -d, --daum [default]    다음 서비스를 이용해서 맞춤법을 교정합니다\n  -p, --pnu               부산대학교 서비스를 이용해서 맞춤법을 교정합니다\n  -a, --all               두 서비스의 모든 결과를 반영해서 맞춤법을 교정합니다\n  -h, --info              도움말을 출력합니다\n\n버그 리포트와 제안: \u003chttps://github.com/9beach/hanspell/issues\u003e\n한스펠 홈 페이지: \u003chttps://github.com/9beach/hanspell/\u003e\n```\n\n문장을 직접 입력하거나 클립보드에서 복사해서 맞춤법을 교정할 수 있습니다. 다음은\n사용 예시입니다. \u003ckbd\u003eCTRL + D\u003c/kbd\u003e는 줄을 바꾸고 맨 앞에서 입력해야 합니다.\n\n\u003cpre\u003e\n$ hanspell-cli\n나는 차가운 모래속에 두 손을 넣고 검게 빛나는 바다를 바라본다.\n우주의 가장자리 같다.\n쇼코는 해변에 서 있으면 이세상의 변두리에 선 느낌이 든다고 말했었다.\n\u003ckbd\u003eCTRL + D\u003c/kbd\u003e\n모래속에 \u003cfont color=grey\u003e-\u003e\u003c/font\u003e 모래 속에\u003cfont color=grey\u003e\n띄어쓰기 오류입니다. 대치어를 참고하여 고쳐 쓰세요.\u003c/font\u003e\n이세상의 \u003cfont color=grey\u003e-\u003e\u003c/font\u003e 이 세상의\u003cfont color=grey\u003e\n관형사는 뒤에 오는 말과 띄어 쓰는 것이 옳습니다.\n...\u003c/font\u003e\n\u003c/pre\u003e\n\n![스크린숏](https://raw.githubusercontent.com/9beach/hanspell/master/hanspell-screenshot.png '한스펠 스크린숏')\n\n파일의 맞춤법을 교정하려면 다음과 같이 명령합니다.\n\n```sh\ncat your-text | hanspell-cli\n```\n\n로그는 생략한 채 교정된 문장만 보려면 다음과 같이 명령합니다.\n\n```console\n$ cat your-text | hanspell-cli 2\u003e /dev/null\n나는 차가운 모래 속에 두 손을 넣고 검게 빛나는 바다를 바라본다.\n우주의 가장자리 같다.\n쇼코는 해변에 서 있으면 이 세상의 변두리에 선 느낌이 든다고 말했었다.\n```\n\n교정 제안만 보려면 다음과 같이 명령합니다.\n\n```sh\ncat your-text | hanspell-cli 2\u003e\u00261 \u003e /dev/null | grep '-\u003e'\n```\n\n클립보드에 복사된 문장을 교정하려면, macOS 사용자는 `pbpaste`,\nX 윈도 시스템 사용자는 `xclip -o`, 마이크로소프트 윈도우 사용자는\n`powershell.exe Get-Clipboard` 명령을 이용할 수 있습니다.\n\n```sh\npbpaste | hanspell-cli\n```\n\n`~/.hanspell-ignore` 파일에 교정 대상에서 제외할 문자열을\n[글로브 패턴](\u003chttps://ko.wikipedia.org/wiki/글로브_(프로그래밍)\u003e)으로 지정할 수\n있습니다. ‘그로떼스끄’로 시작하는 문자열과 ‘빠이’를 교정 대상에서 제외하려면\n다음과 같이 설정하세요.\n\n```txt\n그로떼스끄*\n빠이\n```\n\n`~/.hanspell-history` 파일에는 맞춤법 교정 내용이 기록됩니다.\n\n```txt\n내노라하는 -\u003e 내로라하는\n전세계 -\u003e 전 세계\n그 뿐만 -\u003e 그뿐만\n때 마다 -\u003e 때마다\n했는 지 -\u003e 했는지\n...\n```\n\n아래는 사용자가 자주 틀리는 맞춤법을 빈도순으로 보여주는 셸 스크립트입니다. 리눅스나 macOS 환경에서만 작동합니다.\n\n```console\n$ sort \u003c ~/.hanspell-history | uniq -c | sort -nr | head -n 5\n  17 모래속에 -\u003e 모래 속에\n  13 그 뿐만 -\u003e 그뿐만\n  13 했는 지 -\u003e 했는지\n  13 한바퀴 -\u003e 한 바퀴\n   7 내노라하는 -\u003e 내로라하는\n```\n\n## 마이크로소프트 윈도우 환경\n\n`hanspell`은 UTF-8 인코딩으로 저장된 파일만 인식합니다.\n\n```bash\ntype your-text.utf-8 | hanspell-cli\n```\n\n홈 디렉터리의 `.hanspell-ignore` 파일 또한 UTF-8 인코딩으로 저장해야 합니다.\n\n## 라이브러리 사용법\n\nNode.js 프로젝트에서 `hanspell` 라이브러리를 사용하려면 다음을 실행하세요.\n\n```bash\ncd my-project \u0026\u0026 npm install --save hanspell\n```\n\n`hanspell` 라이브러리에는 `spellCheckByDAUM` 함수와 `spellCheckByPNU` 함수가 있습니다. 다음은 사용 예입니다.\n\n```javascript\n// hanspell-example.js\nconst hanspell = require('hanspell');\n\nconst sentence = '리랜드는 얼굴 골격이 굵은게,';\nconst end = function () {\n  console.log('// check ends');\n};\nconst error = function (err) {\n  console.error('// error: ' + err);\n};\n\nhanspell.spellCheckByDAUM(sentence, 6000, console.log, end, error);\nhanspell.spellCheckByPNU(sentence, 6000, console.log, end, error);\n```\n\n다음의 결과가 예상됩니다.\n\n```console\n[\n  {\n    type: 'space',\n    token: '굵은게,',\n    suggestions: [ '굵은 게,' ],\n    context: '얼굴 골격이 굵은게,'\n  }\n]\n// check ends\n[\n  {\n    token: '리랜드는',\n    suggestions: [ '이랜드는' ],\n    info: '철자 검사를 해 보니 이 어절은 분석할 수 없으므로...'\n  },\n  {\n    token: '굵은게',\n    suggestions: [ '굵은 게', '굵은데' ],\n    info: '어미의 사용이 잘못되었습니다. 문서 작성시 필요에...'\n  }\n]\n// check ends\n```\n\n두 함수의 호출 결과는 모두 `token`, `suggestions` 속성을 가집니다.\n`spellCheckByDAUM`은 `type`, `context` 속성을, `spellCheckByPNU`는 `info` 속성을 추가로 가집니다.\n\n위의 예시에서 `sentence`가 300 단어 또는 1000자를 넘으면, 인자로 전달된\n`console.log`는 여러 번 호출되지만 `end`는 마지막에 한 번만 호출됩니다.\n\n## 라이선스 고지\n\n이 프로그램의 소스 코드는 MIT 라이선스를 따르지만, 부산대학교 인공지능연구실/(주)나라인포테크의 맞춤법 웹 서비스는 권리자가 고지한 대로 개인이나 학생만 무료로 사용할 수 있습니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9beach%2Fhanspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9beach%2Fhanspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9beach%2Fhanspell/lists"}