mirror of
https://github.com/NomaDamas/k-skill.git
synced 2026-06-24 02:04:11 +00:00
Align Middle Korean profile contract with implementation
Preserve the existing date-before-lexicon transform order and document it as the v1 contract instead of reordering an already-reviewed helper. Constraint: PR #281 review requested the docs/contract mismatch be resolved with TDD evidence. Rejected: Reordering the converter | would alter current output behavior beyond the approved follow-up. Confidence: high Scope-risk: narrow Directive: Treat middle-korean-style-v1 output-changing rule order edits as contract changes that need regression tests and docs updates. Tested: node --test scripts/test_korean_middle_korean.js; npm run lint; npm run typecheck; npm run pack:dry-run; npm run test without pip bootstrap commands; installed-skill smoke. Not-tested: npm run test direct bootstrap remains blocked locally by Homebrew Python 3.14 pyexpat/libexpat symbol mismatch.
This commit is contained in:
parent
3e6227b9c7
commit
2509e39a28
2 changed files with 19 additions and 2 deletions
|
|
@ -21,12 +21,14 @@ LLM에게 "중세 국어처럼"이라고만 요청하면 변환 강도와 표기
|
|||
|
||||
프로필은 `middle-korean-style-v1`이다.
|
||||
|
||||
- 결정론적 lexicon 치환을 먼저 적용한다.
|
||||
- 날짜 단위는 `年`, `月`, `日`로 바꾼다.
|
||||
- 날짜 단위 정규화를 먼저 적용한다. `2015년 7월 21일`은 `2015年 7月 21日`처럼 바뀐다.
|
||||
- 그다음 결정론적 lexicon 치환을 적용한다.
|
||||
- 일부 현대 조사를 중세국어풍 조사로 바꾼다.
|
||||
- 일부 현대 어미를 `ᄒᆞ-` 계열 중세국어풍 어미로 바꾼다.
|
||||
- 변환하지 못한 내용은 원문 의미 보존을 위해 그대로 둔다.
|
||||
|
||||
`middle-korean-style-v1`의 출력 변경은 호환성에 영향을 주는 계약 변경으로 본다. 새 규칙을 추가하거나 순서를 바꿀 때는 회귀 테스트와 문서 예시를 함께 갱신한다.
|
||||
|
||||
## CLI 사용 예시
|
||||
|
||||
### 기본 JSON 출력
|
||||
|
|
|
|||
|
|
@ -49,6 +49,21 @@ test("createReport exposes deterministic metadata and replacement evidence", ()
|
|||
assert.match(report.contract, /deterministic/i);
|
||||
});
|
||||
|
||||
test("documentation records the v1 rule order and compatibility policy", () => {
|
||||
const docs = fs.readFileSync(path.join(__dirname, "..", "docs", "features", "korean-middle-korean.md"), "utf8");
|
||||
|
||||
assert.match(docs, /날짜 단위 정규화를 먼저 적용한다/);
|
||||
assert.match(docs, /그다음 결정론적 lexicon 치환을 적용한다/);
|
||||
assert.match(docs, /`middle-korean-style-v1`의 출력 변경/);
|
||||
|
||||
const report = createReport("2015년 7월 21일 배우가 말했다.");
|
||||
const firstLexiconIndex = report.replacements.findIndex((replacement) => replacement.kind === "lexicon");
|
||||
const lastDateIndex = report.replacements.findLastIndex((replacement) => replacement.kind === "date");
|
||||
|
||||
assert.ok(lastDateIndex >= 0);
|
||||
assert.ok(firstLexiconIndex > lastDateIndex);
|
||||
});
|
||||
|
||||
test("parseArgs enforces a single input source", () => {
|
||||
assert.deepEqual(parseArgs(["--text", "가나다"]), {
|
||||
format: "json",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue