n8n-nodes-kordoc 0.1.0
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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/nodes/KorDoc/KorDoc.node.d.ts +5 -0
- package/dist/nodes/KorDoc/KorDoc.node.js +111 -0
- package/dist/nodes/KorDoc/KorDoc.node.js.map +1 -0
- package/dist/nodes/KorDoc/kordoc.svg +5 -0
- package/dist/vendor/kordoc/LICENSE +21 -0
- package/dist/vendor/kordoc/NOTICE +172 -0
- package/dist/vendor/kordoc/THIRD_PARTY/hml-equation-parser.LICENSE +201 -0
- package/dist/vendor/kordoc/THIRD_PARTY/hml-equation-parser.txt +35 -0
- package/dist/vendor/kordoc/THIRD_PARTY/opendataloader-pdf.txt +32 -0
- package/dist/vendor/kordoc/THIRD_PARTY/pix2text.txt +17 -0
- package/dist/vendor/kordoc/index.cjs +60156 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 chowhi123
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# n8n-nodes-kordoc
|
|
2
|
+
|
|
3
|
+
[`kordoc`](https://github.com/chrisryugj/kordoc)를 사용해 HWP, HWPX, HWPML, PDF, XLS, XLSX, DOCX 문서를 Markdown 또는 구조화 JSON으로 변환하는 n8n 커뮤니티 노드입니다.
|
|
4
|
+
|
|
5
|
+
## 설치
|
|
6
|
+
|
|
7
|
+
### n8n Community Nodes
|
|
8
|
+
|
|
9
|
+
1. n8n에서 **Settings > Community Nodes**로 이동합니다.
|
|
10
|
+
2. **Install**을 누르고 `n8n-nodes-kordoc`를 입력합니다.
|
|
11
|
+
3. 설치 후 n8n을 다시 시작합니다.
|
|
12
|
+
|
|
13
|
+
자체 호스팅 환경에서는 n8n 사용자 디렉터리에서도 설치할 수 있습니다.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd ~/.n8n/nodes
|
|
17
|
+
npm install n8n-nodes-kordoc
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Node.js 22 이상이 필요합니다.
|
|
21
|
+
|
|
22
|
+
## 사용법
|
|
23
|
+
|
|
24
|
+
1. 이전 노드에서 문서를 바이너리 데이터로 준비합니다. 기본 바이너리 속성명은 `data`입니다.
|
|
25
|
+
2. **KorDoc Parser** 노드를 추가합니다.
|
|
26
|
+
3. 다음 옵션을 설정하고 워크플로를 실행합니다.
|
|
27
|
+
|
|
28
|
+
| 옵션 | 기본값 | 설명 |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| Binary Property | `data` | 입력 문서가 들어 있는 바이너리 속성명 |
|
|
31
|
+
| Output Format | `markdown` | `markdown`은 변환된 문자열, `json`은 KorDoc의 구조화 파싱 결과를 반환 |
|
|
32
|
+
| Extract Images | `false` | 추출 이미지를 `image_0`, `image_1` 등의 출력 바이너리 속성으로 반환 |
|
|
33
|
+
|
|
34
|
+
Markdown 출력 예시:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"fileName": "example.hwpx",
|
|
39
|
+
"content": "# 변환된 마크다운 내용...",
|
|
40
|
+
"parsedAt": "2026-07-20T10:00:00.000Z"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`Output Format`이 `json`이면 `content`에 `fileType`, `markdown`, `blocks`, `metadata`, `outline`, `warnings`가 포함됩니다. 이미지 바이트는 JSON에 중복 저장하지 않으며, **Extract Images**를 켰을 때만 n8n 바이너리 출력으로 제공합니다.
|
|
45
|
+
|
|
46
|
+
입력 바이너리가 없거나 KorDoc이 파싱 오류를 반환하면 노드가 `NodeOperationError`를 발생시킵니다. n8n의 **Continue On Fail**을 켜면 실패한 입력은 워크플로를 중단하지 않고 `error` 필드로 반환됩니다.
|
|
47
|
+
|
|
48
|
+
## 개발
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install
|
|
52
|
+
npm run build
|
|
53
|
+
npm test
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
빌드 결과는 `dist/`에 생성됩니다. `kordoc`는 GitHub upstream을 직접 참조하며, 매일 실행되는 GitHub Actions 워크플로가 새 커밋을 감지하면 패치 버전을 올리고 빌드한 뒤 커밋과 태그를 푸시합니다.
|
|
57
|
+
|
|
58
|
+
## npm 배포
|
|
59
|
+
|
|
60
|
+
`v0.1.0` 형식의 태그가 푸시되면 `.github/workflows/publish.yml`이 빌드와 테스트를 거쳐 npm에 provenance와 함께 배포합니다. 자동 KorDoc 업데이트가 만든 태그도 같은 워크플로를 호출합니다.
|
|
61
|
+
|
|
62
|
+
첫 배포 전 npm에서 패키지 쓰기 권한이 있는 access token을 만들고, GitHub 저장소의 **Settings > Secrets and variables > Actions > Repository secrets**에 `NPM_TOKEN`이라는 이름으로 등록합니다. 워크플로는 이 secret을 `NODE_AUTH_TOKEN`으로만 주입하며 저장소 파일에는 기록하지 않습니다.
|
|
63
|
+
|
|
64
|
+
수동 배포는 먼저 버전과 lockfile을 올리고 같은 버전의 태그를 푸시합니다.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm version patch
|
|
68
|
+
git push --follow-tags
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 라이선스
|
|
72
|
+
|
|
73
|
+
MIT
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KorDoc = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const { parse } = require('../../vendor/kordoc/index.cjs');
|
|
6
|
+
class KorDoc {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'KorDoc Parser',
|
|
10
|
+
name: 'korDoc',
|
|
11
|
+
icon: 'file:kordoc.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Convert HWP, HWPX, PDF, and Office documents to Markdown or JSON',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'KorDoc Parser',
|
|
17
|
+
},
|
|
18
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
19
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
+
properties: [
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Binary Property',
|
|
23
|
+
name: 'binaryPropertyName',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: 'data',
|
|
26
|
+
required: true,
|
|
27
|
+
description: 'Name of the binary property containing the document',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Output Format',
|
|
31
|
+
name: 'outputFormat',
|
|
32
|
+
type: 'options',
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
name: 'Markdown',
|
|
36
|
+
value: 'markdown',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'JSON',
|
|
40
|
+
value: 'json',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
default: 'markdown',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Extract Images',
|
|
47
|
+
name: 'extractImages',
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
default: false,
|
|
50
|
+
description: 'Whether to return embedded images as binary properties',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
async execute() {
|
|
56
|
+
var _a, _b, _c;
|
|
57
|
+
const items = this.getInputData();
|
|
58
|
+
const returnData = [];
|
|
59
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
60
|
+
try {
|
|
61
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', itemIndex);
|
|
62
|
+
const outputFormat = this.getNodeParameter('outputFormat', itemIndex);
|
|
63
|
+
const extractImages = this.getNodeParameter('extractImages', itemIndex);
|
|
64
|
+
const inputBinary = (_a = items[itemIndex].binary) === null || _a === void 0 ? void 0 : _a[binaryPropertyName];
|
|
65
|
+
if (!inputBinary) {
|
|
66
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No binary data found in property "${binaryPropertyName}"`, { itemIndex });
|
|
67
|
+
}
|
|
68
|
+
const buffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
|
|
69
|
+
const result = await parse(buffer);
|
|
70
|
+
if (!result.success) {
|
|
71
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `KorDoc parsing failed: ${result.error}${result.code ? ` (${result.code})` : ''}`, { itemIndex });
|
|
72
|
+
}
|
|
73
|
+
const content = outputFormat === 'markdown'
|
|
74
|
+
? result.markdown
|
|
75
|
+
: JSON.parse(JSON.stringify({ ...result, images: undefined }, (key, value) => (key === 'imageData' ? undefined : value)));
|
|
76
|
+
const binary = {};
|
|
77
|
+
if (extractImages) {
|
|
78
|
+
for (const [imageIndex, image] of ((_b = result.images) !== null && _b !== void 0 ? _b : []).entries()) {
|
|
79
|
+
binary[`image_${imageIndex}`] = await this.helpers.prepareBinaryData(Buffer.from(image.data), image.filename, image.mimeType);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
returnData.push({
|
|
83
|
+
json: {
|
|
84
|
+
fileName: (_c = inputBinary.fileName) !== null && _c !== void 0 ? _c : 'document',
|
|
85
|
+
content,
|
|
86
|
+
parsedAt: new Date().toISOString(),
|
|
87
|
+
},
|
|
88
|
+
...(Object.keys(binary).length > 0 ? { binary } : {}),
|
|
89
|
+
pairedItem: { item: itemIndex },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (this.continueOnFail()) {
|
|
94
|
+
returnData.push({
|
|
95
|
+
json: {
|
|
96
|
+
error: error instanceof Error ? error.message : String(error),
|
|
97
|
+
},
|
|
98
|
+
pairedItem: { item: itemIndex },
|
|
99
|
+
});
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
throw error instanceof n8n_workflow_1.NodeOperationError
|
|
103
|
+
? error
|
|
104
|
+
: new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return [returnData];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.KorDoc = KorDoc;
|
|
111
|
+
//# sourceMappingURL=KorDoc.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KorDoc.node.js","sourceRoot":"","sources":["../../../nodes/KorDoc/KorDoc.node.ts"],"names":[],"mappings":";;;AAQA,+CAAuE;AA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AU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;qBAC/B,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBAED,MAAM,KAAK,YAAY,iCAAkB;oBACxC,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YACjE,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AApID,wBAoIC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="KorDoc">
|
|
2
|
+
<path fill="#2f6fed" d="M14 4h25l11 11v45H14z"/>
|
|
3
|
+
<path fill="#fff" opacity=".85" d="M39 4v13h11z"/>
|
|
4
|
+
<path fill="none" stroke="#fff" stroke-linecap="round" stroke-width="4" d="M23 29h18M23 38h18M23 47h12"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 chrisryugj
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
kordoc
|
|
2
|
+
Copyright 2026 chrisryugj
|
|
3
|
+
Licensed under the MIT License
|
|
4
|
+
|
|
5
|
+
This project includes code derived from the following third-party works:
|
|
6
|
+
|
|
7
|
+
================================================================================
|
|
8
|
+
|
|
9
|
+
OpenDataLoader PDF (opendataloader-pdf)
|
|
10
|
+
https://github.com/opendataloader-project/opendataloader-pdf
|
|
11
|
+
|
|
12
|
+
Copyright 2025-2026 Hancom, Inc.
|
|
13
|
+
Licensed under the Apache License, Version 2.0
|
|
14
|
+
|
|
15
|
+
Used in:
|
|
16
|
+
- src/pdf/line-detector.ts — TableBorderBuilder algorithm (line-based table
|
|
17
|
+
detection via PDF graphics commands, grid construction from line intersections)
|
|
18
|
+
- src/pdf/cluster-detector.ts — ClusterTableConsumer algorithm (cluster-based
|
|
19
|
+
borderless table detection via text alignment patterns)
|
|
20
|
+
|
|
21
|
+
Modifications:
|
|
22
|
+
- TypeScript rewrite from Java/Kotlin
|
|
23
|
+
- pdfjs-dist v4/v5 compatibility layer
|
|
24
|
+
- Korean PDF-specific optimizations (character spacing, cell text merging)
|
|
25
|
+
|
|
26
|
+
You may obtain a copy of the Apache License at:
|
|
27
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
28
|
+
|
|
29
|
+
================================================================================
|
|
30
|
+
|
|
31
|
+
hml-equation-parser
|
|
32
|
+
https://github.com/OpenBapul/hml-equation-parser
|
|
33
|
+
|
|
34
|
+
Copyright 2018 Open Bapul
|
|
35
|
+
Licensed under the Apache License, Version 2.0
|
|
36
|
+
|
|
37
|
+
Used in:
|
|
38
|
+
- src/hwpx/equation.ts — hmlToLatex() (HULK-style HWPX equation script →
|
|
39
|
+
LaTeX) derived from hulkEqParser.py and hulkReplaceMethod.py
|
|
40
|
+
|
|
41
|
+
Modifications:
|
|
42
|
+
- TypeScript rewrite from Python 3
|
|
43
|
+
- Inlined convertMap.json as TS constants
|
|
44
|
+
- Graceful error handling so failed conversion drops the equation rather
|
|
45
|
+
than leaking the HWP alt-text ("수식입니다") through the document
|
|
46
|
+
|
|
47
|
+
See THIRD_PARTY/hml-equation-parser.LICENSE for the full license text.
|
|
48
|
+
|
|
49
|
+
You may obtain a copy of the Apache License at:
|
|
50
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
51
|
+
|
|
52
|
+
================================================================================
|
|
53
|
+
|
|
54
|
+
cfb (Compound File Binary)
|
|
55
|
+
https://github.com/SheetJS/js-cfb
|
|
56
|
+
|
|
57
|
+
Copyright 2013-present SheetJS LLC
|
|
58
|
+
Licensed under the Apache License, Version 2.0
|
|
59
|
+
|
|
60
|
+
Used as a dependency for HWP 5.x OLE2 container parsing.
|
|
61
|
+
No modifications — used as a bundled npm package.
|
|
62
|
+
|
|
63
|
+
================================================================================
|
|
64
|
+
|
|
65
|
+
pdfjs-dist (PDF.js)
|
|
66
|
+
https://github.com/mozilla/pdf.js
|
|
67
|
+
|
|
68
|
+
Copyright Mozilla Foundation
|
|
69
|
+
Licensed under the Apache License, Version 2.0
|
|
70
|
+
|
|
71
|
+
Used as an optional peer dependency for PDF text extraction.
|
|
72
|
+
No modifications — used as an npm package.
|
|
73
|
+
|
|
74
|
+
================================================================================
|
|
75
|
+
|
|
76
|
+
JSZip
|
|
77
|
+
https://github.com/Stuk/jszip
|
|
78
|
+
|
|
79
|
+
Copyright 2009-2016 Stuart Knightley, David Duponchel, Franz Buchinger, Antonio Afonso
|
|
80
|
+
Dual-licensed under the MIT License OR GPL-3.0-or-later
|
|
81
|
+
This project uses JSZip under the MIT License.
|
|
82
|
+
|
|
83
|
+
Used for ZIP-based format parsing (HWPX, XLSX, DOCX).
|
|
84
|
+
No modifications — used as an npm package.
|
|
85
|
+
|
|
86
|
+
================================================================================
|
|
87
|
+
|
|
88
|
+
rhwp
|
|
89
|
+
https://github.com/edwardkim/rhwp
|
|
90
|
+
|
|
91
|
+
Copyright edwardkim
|
|
92
|
+
Licensed under the MIT License
|
|
93
|
+
|
|
94
|
+
Used in:
|
|
95
|
+
- src/hwp5/cfb-lenient.ts — LenientCfbReader algorithm (FAT/directory/mini-stream
|
|
96
|
+
parsing for corrupted CFB containers)
|
|
97
|
+
- src/hwp5/crypto.ts — Distribution document decryption algorithm (AES key
|
|
98
|
+
extraction from MSVC LCG-scrambled payload)
|
|
99
|
+
|
|
100
|
+
Modifications:
|
|
101
|
+
- TypeScript rewrite from Rust
|
|
102
|
+
- Added sector size validation, chain length limits, and cycle detection
|
|
103
|
+
- Pure JS AES-128 ECB implementation (no native dependency)
|
|
104
|
+
|
|
105
|
+
================================================================================
|
|
106
|
+
|
|
107
|
+
Pix2Text — Mathematical Formula Detection & Recognition
|
|
108
|
+
https://github.com/breezedeus/Pix2Text
|
|
109
|
+
|
|
110
|
+
Copyright 2023-2024 breezedeus
|
|
111
|
+
MFD (Mathematical Formula Detection): trained on Ultralytics YOLOv8 — MFD model
|
|
112
|
+
weights themselves are distributed under MIT via the HuggingFace repository
|
|
113
|
+
`breezedeus/pix2text-mfd`, but the underlying YOLOv8 architecture carries an
|
|
114
|
+
AGPL-3.0 license from Ultralytics. Users distributing derivative works built on
|
|
115
|
+
MFD outputs should review Ultralytics' licensing terms.
|
|
116
|
+
MFR (Mathematical Formula Recognition): HuggingFace `breezedeus/pix2text-mfr`,
|
|
117
|
+
MIT License.
|
|
118
|
+
|
|
119
|
+
Used in:
|
|
120
|
+
- src/pdf/formula/detector.ts — YOLOv8 letterbox preprocessing, NMS post-processing
|
|
121
|
+
- src/pdf/formula/recognizer.ts — DeiT encoder + TrOCR decoder greedy decoding
|
|
122
|
+
- src/pdf/formula/postprocess.ts — LaTeX output cleanup (derived from Pix2Text
|
|
123
|
+
`latex_ocr.py` post_process)
|
|
124
|
+
|
|
125
|
+
Models are downloaded at runtime from HuggingFace with SHA-256 verification.
|
|
126
|
+
No model weights are redistributed with this package. Algorithm implementations
|
|
127
|
+
are original TypeScript ports referencing the Pix2Text algorithm descriptions.
|
|
128
|
+
|
|
129
|
+
You may obtain a copy of the MIT License at:
|
|
130
|
+
https://opensource.org/licenses/MIT
|
|
131
|
+
|
|
132
|
+
================================================================================
|
|
133
|
+
|
|
134
|
+
PaddleOCR / PP-OCRv5 — Text Detection & Recognition Models
|
|
135
|
+
https://github.com/PaddlePaddle/PaddleOCR
|
|
136
|
+
|
|
137
|
+
Copyright PaddlePaddle Authors
|
|
138
|
+
Licensed under the Apache License, Version 2.0
|
|
139
|
+
|
|
140
|
+
Model weights (ONNX conversions, downloaded at runtime with SHA-256 verification,
|
|
141
|
+
not redistributed with this package):
|
|
142
|
+
- PP-OCRv5_mobile_det (HuggingFace `PaddlePaddle/PP-OCRv5_mobile_det_onnx`)
|
|
143
|
+
- korean_PP-OCRv5_mobile_rec + character dictionary
|
|
144
|
+
(HuggingFace `PaddlePaddle/korean_PP-OCRv5_mobile_rec_onnx`)
|
|
145
|
+
|
|
146
|
+
Used in:
|
|
147
|
+
- src/ocr/engine.ts — DBNet det pre/post-processing (resize_long 960, thresh/
|
|
148
|
+
box_thresh/unclip per official inference.yml; DB unclip approximated with
|
|
149
|
+
axis-aligned component boxes) + CTC greedy decoding, following the PaddleOCR
|
|
150
|
+
inference operator specifications. Original TypeScript implementation.
|
|
151
|
+
- src/ocr/models.ts — model specs + inference.yml character_dict parser
|
|
152
|
+
|
|
153
|
+
You may obtain a copy of the Apache License 2.0 at:
|
|
154
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
155
|
+
|
|
156
|
+
================================================================================
|
|
157
|
+
|
|
158
|
+
claw-hwp
|
|
159
|
+
https://github.com/DoHyun468/claw-hwp
|
|
160
|
+
|
|
161
|
+
Copyright RECON Labs
|
|
162
|
+
Licensed under the MIT License
|
|
163
|
+
|
|
164
|
+
Used in:
|
|
165
|
+
- src/hwpx/chart-gen.ts — OOXML chartSpace 조립(buildChartSpace)·차트 타입 20종
|
|
166
|
+
테이블·계열/축/색 XML 생성을 hwpx-edit.js에서 TS로 이식 (한컴독스 GT 검증 구현)
|
|
167
|
+
- src/form/seal.ts — 도장 부유 배치의 폰트 메트릭 위치 산정(전각/반각 em 폭,
|
|
168
|
+
정렬 이동 보정)과 부유 개체 속성 규칙(treatAsChar=0 + flowWithText=0 +
|
|
169
|
+
allowOverlap=1)을 cell-patch.js placeSealInPlace에서 이식
|
|
170
|
+
|
|
171
|
+
You may obtain a copy of the MIT License at:
|
|
172
|
+
https://opensource.org/licenses/MIT
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
hml-equation-parser
|
|
2
|
+
Version: 0.1.2 (Python)
|
|
3
|
+
Copyright 2018 Open Bapul (OpenBapul/hml-equation-parser)
|
|
4
|
+
License: Apache License, Version 2.0
|
|
5
|
+
Source: https://github.com/OpenBapul/hml-equation-parser
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
Full license text: hml-equation-parser.LICENSE
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
Usage in kordoc:
|
|
24
|
+
The HWPX equation script → LaTeX converter (src/hwpx/equation.ts) is derived
|
|
25
|
+
from hml-equation-parser's hulkEqParser.py and hulkReplaceMethod.py modules.
|
|
26
|
+
The algorithm was re-implemented in TypeScript with no material changes —
|
|
27
|
+
the 5-pass rewrite (frac → rootOf → matrix → bar → brace), the bracket-matching
|
|
28
|
+
helpers, and the three conversion maps (CONVERT_MAP, MIDDLE_CONVERT_MAP,
|
|
29
|
+
BAR/MATRIX/BRACE_CONVERT_MAP) are faithful ports of the original Python.
|
|
30
|
+
|
|
31
|
+
Modifications:
|
|
32
|
+
- TypeScript rewrite from Python 3
|
|
33
|
+
- Inlined convertMap.json as TS constants (resolveJsonModule kept optional)
|
|
34
|
+
- Added graceful fallback in the HWPX parser: if conversion throws, the
|
|
35
|
+
equation is dropped instead of leaking the HWP alt-text ("수식입니다").
|