hanspell 0.10.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/lib/naver-spell-check.js +11 -2
- package/package.json +15 -2
package/README.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
[한스펠 릴리스](https://github.com/9beach/hanspell/releases)에서 실행파일을 다운로드 하세요.
|
|
12
12
|
|
|
13
|
+
macOS에서는 다운로드한 실행 파일에 검역(quarantine) 속성이 붙어 "확인되지
|
|
14
|
+
않은 개발자" 경고가 뜹니다. 다음 명령으로 한 번만 속성을 지우면 이후
|
|
15
|
+
경고 없이 실행됩니다.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
xattr -d com.apple.quarantine ./hanspell
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
소스를 받아서 설치하려면 [Node.js](https://nodejs.org/ko/) 18 이상을 설치한 뒤 다음을 실행하세요.
|
|
14
22
|
|
|
15
23
|
```sh
|
package/lib/naver-spell-check.js
CHANGED
|
@@ -6,7 +6,10 @@ const { decode } = require('html-entities');
|
|
|
6
6
|
|
|
7
7
|
const split = require('./split-string').byWordCount;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// Naver의 SpellerProxy는 GET 쿼리스트링 길이 한도가 약 3300자 (대략 한글
|
|
10
|
+
// 100단어). 안전 여유를 두고 80단어로 청크를 자릅니다.
|
|
11
|
+
const NAVER_MAX_WORDS = 80;
|
|
12
|
+
const NAVER_MIN_INTERVAL = 400;
|
|
10
13
|
const NAVER_PROXY_URL =
|
|
11
14
|
'https://m.search.naver.com/p/csearch/ocontent/util/SpellerProxy';
|
|
12
15
|
const NAVER_PASSPORT_PAGE =
|
|
@@ -155,7 +158,13 @@ function spellCheck(sentence, timeout, check, end, error) {
|
|
|
155
158
|
}
|
|
156
159
|
};
|
|
157
160
|
|
|
158
|
-
|
|
161
|
+
let i = 0;
|
|
162
|
+
function fireNext() {
|
|
163
|
+
handleOne(parts[i]);
|
|
164
|
+
i += 1;
|
|
165
|
+
if (i < parts.length) setTimeout(fireNext, NAVER_MIN_INTERVAL);
|
|
166
|
+
}
|
|
167
|
+
fireNext();
|
|
159
168
|
}
|
|
160
169
|
|
|
161
170
|
module.exports = spellCheck;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanspell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "(주)다음과 네이버(주)의 온라인 서비스를 이용한 한글 맞춤법 검사기.",
|
|
5
5
|
"homepage": "https://github.com/9beach/hanspell",
|
|
6
6
|
"author": {
|
|
@@ -23,7 +23,20 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"all": "npm run lint && npm test",
|
|
25
25
|
"test": "mocha && test/cli.test.sh",
|
|
26
|
-
"lint": "eslint ."
|
|
26
|
+
"lint": "eslint .",
|
|
27
|
+
"build": "pkg . --out-path bin"
|
|
28
|
+
},
|
|
29
|
+
"pkg": {
|
|
30
|
+
"scripts": [
|
|
31
|
+
"lib/**/*.js"
|
|
32
|
+
],
|
|
33
|
+
"targets": [
|
|
34
|
+
"node20-linux-x64",
|
|
35
|
+
"node20-macos-arm64",
|
|
36
|
+
"node20-macos-x64",
|
|
37
|
+
"node20-win-x64"
|
|
38
|
+
],
|
|
39
|
+
"outputPath": "bin"
|
|
27
40
|
},
|
|
28
41
|
"preferGlobal": true,
|
|
29
42
|
"bin": {
|