kordoc
Copyright 2026 chrisryugj
Licensed under the MIT License

This project includes code derived from the following third-party works:

================================================================================

OpenDataLoader PDF (opendataloader-pdf)
https://github.com/opendataloader-project/opendataloader-pdf

Copyright 2025-2026 Hancom, Inc.
Licensed under the Apache License, Version 2.0

Used in:
- src/pdf/line-detector.ts — TableBorderBuilder algorithm (line-based table
  detection via PDF graphics commands, grid construction from line intersections)
- src/pdf/cluster-detector.ts — ClusterTableConsumer algorithm (cluster-based
  borderless table detection via text alignment patterns)

Modifications:
- TypeScript rewrite from Java/Kotlin
- pdfjs-dist v4/v5 compatibility layer
- Korean PDF-specific optimizations (character spacing, cell text merging)

You may obtain a copy of the Apache License at:
http://www.apache.org/licenses/LICENSE-2.0

================================================================================

hml-equation-parser
https://github.com/OpenBapul/hml-equation-parser

Copyright 2018 Open Bapul
Licensed under the Apache License, Version 2.0

Used in:
- src/hwpx/equation.ts — hmlToLatex() (HULK-style HWPX equation script →
  LaTeX) derived from hulkEqParser.py and hulkReplaceMethod.py

Modifications:
- TypeScript rewrite from Python 3
- Inlined convertMap.json as TS constants
- Graceful error handling so failed conversion drops the equation rather
  than leaking the HWP alt-text ("수식입니다") through the document

See THIRD_PARTY/hml-equation-parser.LICENSE for the full license text.

You may obtain a copy of the Apache License at:
http://www.apache.org/licenses/LICENSE-2.0

================================================================================

cfb (Compound File Binary)
https://github.com/SheetJS/js-cfb

Copyright 2013-present SheetJS LLC
Licensed under the Apache License, Version 2.0

Used as a dependency for HWP 5.x OLE2 container parsing.
No modifications — used as a bundled npm package.

================================================================================

pdfjs-dist (PDF.js)
https://github.com/mozilla/pdf.js

Copyright Mozilla Foundation
Licensed under the Apache License, Version 2.0

Used as an optional peer dependency for PDF text extraction.
No modifications — used as an npm package.

================================================================================

JSZip
https://github.com/Stuk/jszip

Copyright 2009-2016 Stuart Knightley, David Duponchel, Franz Buchinger, Antonio Afonso
Dual-licensed under the MIT License OR GPL-3.0-or-later
This project uses JSZip under the MIT License.

Used for ZIP-based format parsing (HWPX, XLSX, DOCX).
No modifications — used as an npm package.

================================================================================

rhwp
https://github.com/edwardkim/rhwp

Copyright edwardkim
Licensed under the MIT License

Used in:
- src/hwp5/cfb-lenient.ts — LenientCfbReader algorithm (FAT/directory/mini-stream
  parsing for corrupted CFB containers)
- src/hwp5/crypto.ts — Distribution document decryption algorithm (AES key
  extraction from MSVC LCG-scrambled payload)

Modifications:
- TypeScript rewrite from Rust
- Added sector size validation, chain length limits, and cycle detection
- Pure JS AES-128 ECB implementation (no native dependency)

================================================================================

Pix2Text — Mathematical Formula Detection & Recognition
https://github.com/breezedeus/Pix2Text

Copyright 2023-2024 breezedeus
MFD (Mathematical Formula Detection): trained on Ultralytics YOLOv8 — MFD model
weights themselves are distributed under MIT via the HuggingFace repository
`breezedeus/pix2text-mfd`, but the underlying YOLOv8 architecture carries an
AGPL-3.0 license from Ultralytics. Users distributing derivative works built on
MFD outputs should review Ultralytics' licensing terms.
MFR (Mathematical Formula Recognition): HuggingFace `breezedeus/pix2text-mfr`,
MIT License.

Used in:
- src/pdf/formula/detector.ts — YOLOv8 letterbox preprocessing, NMS post-processing
- src/pdf/formula/recognizer.ts — DeiT encoder + TrOCR decoder greedy decoding
- src/pdf/formula/postprocess.ts — LaTeX output cleanup (derived from Pix2Text
  `latex_ocr.py` post_process)

Models are downloaded at runtime from HuggingFace with SHA-256 verification.
No model weights are redistributed with this package. Algorithm implementations
are original TypeScript ports referencing the Pix2Text algorithm descriptions.

You may obtain a copy of the MIT License at:
https://opensource.org/licenses/MIT

================================================================================

PaddleOCR / PP-OCRv5 — Text Detection & Recognition Models
https://github.com/PaddlePaddle/PaddleOCR

Copyright PaddlePaddle Authors
Licensed under the Apache License, Version 2.0

Model weights (ONNX conversions, downloaded at runtime with SHA-256 verification,
not redistributed with this package):
- PP-OCRv5_mobile_det (HuggingFace `PaddlePaddle/PP-OCRv5_mobile_det_onnx`)
- korean_PP-OCRv5_mobile_rec + character dictionary
  (HuggingFace `PaddlePaddle/korean_PP-OCRv5_mobile_rec_onnx`)

Used in:
- src/ocr/engine.ts — DBNet det pre/post-processing (resize_long 960, thresh/
  box_thresh/unclip per official inference.yml; DB unclip approximated with
  axis-aligned component boxes) + CTC greedy decoding, following the PaddleOCR
  inference operator specifications. Original TypeScript implementation.
- src/ocr/models.ts — model specs + inference.yml character_dict parser

You may obtain a copy of the Apache License 2.0 at:
https://www.apache.org/licenses/LICENSE-2.0

================================================================================

korean-handwriting-rec — Korean Handwriting Recognition Model (optional)
https://github.com/VerifiedIdiot/korean-handwriting-rec

Licensed under the Apache License, Version 2.0 (as stated by the model repository)

Model weights (ONNX, downloaded at runtime only when `ocrRec: "handwriting"` is
selected, with SHA-256 verification, not redistributed with this package):
- rec_korean_hw.onnx (HuggingFace `Rebeccaaaaaaaa/korean-handwriting-rec`,
  pinned revision bb4c2714cf6b05e5d13bfe22199d0e6d30866597)

Fine-tuned from korean_PP-OCRv5_mobile_rec (PaddleOCR, above) and uses its
character dictionary. The base model, conversion tools and training data
sources (AI Hub datasets) are described in the model repository README.
No training data is redistributed with this package.

Used in:
- src/ocr/models.ts — model spec (OCR_HANDWRITING_REC_MODEL)

You may obtain a copy of the Apache License 2.0 at:
https://www.apache.org/licenses/LICENSE-2.0

================================================================================

claw-hwp
https://github.com/DoHyun468/claw-hwp

Copyright (c) 2026 DoHyun468
Licensed under the MIT License

Used in:
- src/hwpx/chart-gen.ts — OOXML chartSpace 조립(buildChartSpace)·차트 타입 20종
  테이블·계열/축/색 XML 생성을 hwpx-edit.js에서 TS로 이식 (한컴독스 GT 검증 구현)
- src/form/seal.ts — 도장 부유 배치의 폰트 메트릭 위치 산정(전각/반각 em 폭,
  정렬 이동 보정)과 부유 개체 속성 규칙(treatAsChar=0 + flowWithText=0 +
  allowOverlap=1)을 cell-patch.js placeSealInPlace에서 이식
- src/form/match.ts — secure-fill 포맷엔진과 require_occurrence 규칙 이식
- src/validate.ts — validate.py 의 실측 검사셋 이식

라이선스 전문: THIRD_PARTY/claw-hwp.LICENSE

You may obtain a copy of the MIT License at:
https://opensource.org/licenses/MIT

================================================================================

hwp-auto-docfit
https://github.com/haijun93/hwp-auto-docfit

Copyright (c) 2026 haijun93 (마포구청 공혁준)
Licensed under the MIT License

Used in:
- src/hwpx/gongmun-lint.ts — 기간 대시·요일·"끝."/붙임 2타 규칙 착안, 공공언어 쉬운 말·맞춤법
  낱말표와 조사 경계식 (document_rules.py·writing_aids.py·korean_proofread.py)
- src/hwpx/paste-clean.ts — 생성형 AI 붙여넣기 흔적(보이지 않는 글자·† 인용 표시·이스케이프된 굵게) 정리 규칙 착안 (pasted_text.py)
- src/hwpx/gongmun-typo.ts — 열거 뒤 '등'·'낱말 숫자,' 열거 묶음 빈칸 규칙 착안
- src/hwpx/number-lint.ts — 본문 수치 ↔ 표 수치 대조 범위·임계값 (number_check.py)
- src/hwpx/level-styles.ts — 단계별 대표 서식 투표 임계값과 편차 검수 (style_unify.py·document_review.py)
- src/roundtrip/integrity.ts — 패치 결과 다층 무결성 검사 착안 (fidelity/verify.py)

Modifications:
- TypeScript 재구현(규칙·임계값은 kordoc 코퍼스로 다시 확인), 한/글 COM 의존 없음

라이선스 전문: THIRD_PARTY/hwp-auto-docfit.LICENSE

You may obtain a copy of the MIT License at:
https://opensource.org/licenses/MIT

================================================================================

korean-report-hwpx
https://github.com/UpstageAI/korean-report-hwpx

Copyright (c) 2026 Upstage (작성 Mia, 윤승미)
Licensed under the MIT License

Used in:
- src/hwpx/agency-styles.ts — 중앙행정기관별 서식 실측값(정책브리핑 보도자료 2,670건 집계: rules/·rules_report/·
  rules_report/_참고머리.json)을 scripts/build-agency-styles.mjs 로 옮긴 데이터. 계층값 보정 규칙(engine/compose.py·report.py)도 같다
- src/hwpx/gen-docframe.ts — 보도자료 담당 표 6칸 꼴과 칸 폭 비율 (engine/compose.py contact)

Modifications:
- 원천 JSON 을 그대로 싣지 않고 kordoc 이 쓰는 값(단계 글꼴·크기·2단계 부호·표 머리·라벨 칸 색·본문 방식)만 뽑았다.
  연한 라벨 칸 바탕의 글자색은 검정으로 정했다(원천 기본은 흰색). 생성 엔진은 kordoc 자체 구현

라이선스 전문: THIRD_PARTY/korean-report-hwpx.LICENSE

You may obtain a copy of the MIT License at:
https://opensource.org/licenses/MIT
