hanfix 0.1.1 → 0.1.2
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 +14 -0
- package/package.json +1 -2
- package/src/hanfix.js +3 -4
package/README.md
CHANGED
|
@@ -31,3 +31,17 @@ Options:
|
|
|
31
31
|
-c, --include-corrected include corrected text in the result
|
|
32
32
|
-h, --help display help for command
|
|
33
33
|
```
|
|
34
|
+
|
|
35
|
+
결과는 JSON으로 출력되며 다음과 같은 형식입니다.
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"errors": [
|
|
40
|
+
{
|
|
41
|
+
"original": "원래 텍스트...",
|
|
42
|
+
"suggestions": ["교정제안1", "교정제안2", ...],
|
|
43
|
+
"explanation": "설명...",
|
|
44
|
+
"examples": ["예문1...", "예문2...", ...]
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanfix",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Korean grammar checker using Daum grammar checker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"한글",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"jsdom": "^27.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/js": "^9.39.2",
|
|
39
38
|
"eslint": "^9.39.2",
|
|
40
39
|
"globals": "^17.0.0"
|
|
41
40
|
}
|
package/src/hanfix.js
CHANGED
|
@@ -17,10 +17,9 @@ function parse(html) {
|
|
|
17
17
|
|
|
18
18
|
return [...document.querySelectorAll('div.cont_spell a')].map(node => {
|
|
19
19
|
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
helpText: node.querySelector('[id="help"] li')?.textContent,
|
|
20
|
+
original: node.dataset.errorInput,
|
|
21
|
+
suggestions: [node.dataset.errorOutput],
|
|
22
|
+
explanation: node.querySelector('[id="help"] li')?.textContent,
|
|
24
23
|
examples: [...node.querySelectorAll('#examples li')].map(e => e.textContent)
|
|
25
24
|
}
|
|
26
25
|
});
|