Unify mixed Korean speech levels (formal vs polite endings)
When a Korean guide mixes -ㅂ니다 and -해요 endings, a vague "unify it" prompt rewrites table cells and adds commentary. Rules, examples and a script fix that.
A shared Korean guide says 보입니다 in one paragraph and 보여요 in the next, and the table cells end in 제한함, 보관해요 and 접수합니다. Several people edited it over time, and now it needs one voice.
The test document is a made-up internal file-sharing guide: five body paragraphs, two double-quoted spans (a file-name example and a quoted notice from the person in charge), and a four-row table. Counting endings gives 8 formal (-ㅂ니다/-습니다) and 6 polite (-요) sentences in the body, and the four table cells have four different endings. The target:
| Where | Wanted ending |
|---|---|
| Body sentences | Formal style (~합니다, ~해 주십시오) |
| Table content column | Noun phrase ("휴지통 30일 보관") |
| Text inside double quotes | Untouched, character for character |
The short prompt
Make the sentence endings in this Korean text consistent. {whole document}Run in Korean ("어미를 통일해 줘"), the same short instruction turned all four table cells into full formal sentences ("부서당 50GB로 제한합니다") and once changed a word in a cell ("알림이 갑니다" became "알림을 보냅니다"). Run in English, as above, the table came out as noun phrases, but the model put a paragraph of commentary above the document:
아래는 본문을 합니다체(~합니다/~습니다)로 통일한 결과입니다. 요청 표현은 "~주시기 바랍니다"로 맞췄고, 표는 짧은 명사형으로 정리했습니다. 담당자의 인용문은 공지 원문이므로 그대로 두었습니다.The commentary also gives away a wording change: every "-해 주세요" became "-주시기 바랍니다", chosen by the model, not by the instruction. The checker below counts what else changed.
A prompt with rules and examples
Claude's prompting guide says to state what to do instead of what not to do, to match the prompt's own style to the output you want, and to wrap 3-5 examples in <example> tags (control the format of responses, use examples). The third example matters most: it shows a quote with a polite ending being left alone.
Unify only the sentence endings (speech level) of the Korean internal guide inside <document>. Rules:- Every sentence in a body paragraph uses the formal -ㅂ니다/-습니다 style. Request sentences use -해 주십시오 instead of -해 주세요.- Cells in the table's right-hand column end as noun phrases, without a final period. Example: "휴지통 30일 보관".- Text inside double quotation marks stays exactly as it is, character for character.- Do not change the heading, numbers, file names or word choice. Do not merge or split sentences. Keep the number of paragraphs and the table structure.- Output only the converted document, with no explanation. <example>Input: 폴더 용량이 가득 차면 업로드가 막혀요.Output: 폴더 용량이 가득 차면 업로드가 제한됩니다.</example><example>Input: | 업로드 제한 | 파일당 1GB까지 올릴 수 있어요 |Output: | 업로드 제한 | 파일당 최대 1GB |</example><example>Input: 담당자는 "내일까지 보내 주면 돼요."라고 답했습니다.Output: 담당자는 "내일까지 보내 주면 돼요."라고 답했습니다.</example> <document>{whole document}</document>One of the two runs of this prompt:
## 사내 문서 공유 시스템 사용 안내 문서 공유 시스템은 부서별 폴더에 파일을 올려 함께 보는 곳입니다. 처음 접속하면 소속 부서 폴더가 자동으로 보입니다. 다른 부서 폴더는 권한을 받아야 열 수 있습니다. 파일을 올릴 때는 이름 앞에 날짜를 붙여 주십시오. 예를 들어 "20261005_회의록"처럼 쓰면 정렬이 편합니다. 같은 이름의 파일을 다시 올리면 이전 버전이 보관됩니다. 담당자는 이렇게 안내했습니다. "삭제한 파일은 30일 동안 휴지통에 남아 있으니 급하게 복구를 요청하지 않으셔도 됩니다." 이 문장은 공지에서 그대로 가져온 것입니다. 용량이 부족하면 오래된 파일부터 정리해 보십시오. 부서 폴더 한도는 50GB이고, 80%를 넘으면 관리자에게 알림이 갑니다. 정리가 어려우면 문의 게시판에 글을 남겨 주십시오. 문의는 평일 09시부터 18시까지 받습니다. 점심시간에는 답변이 늦어질 수 있습니다. 긴급한 장애는 전화로 연락해 주십시오. | 항목 | 내용 || --- | --- || 폴더 한도 | 부서당 50GB 제한 || 보관 기간 | 휴지통 30일 보관 || 알림 기준 | 사용량 80% 초과 시 관리자 알림 || 문의 시간 | 평일 09시~18시 접수 |No commentary, the same seven blocks, and the table is back to noun phrases. The second run differed in two places in the same paragraph: "50GB이고," became "50GB이며," (the first run changed the original "50GB고요," to "50GB이고,", a connective rather than a sentence ending), and "정리해 보세요" came back as "정리해 주십시오" (the first run had "정리해 보십시오"). The rule said to replace "-해 주세요" with "-해 주십시오", and the model applied it to a sentence that was not a request for a favor, so "try tidying up" became "please tidy up". Review request sentences with diff.
Count the endings
Reading the result will not tell you whether a paragraph was skipped. This script splits the text into body and table cells, classifies sentence endings, compares the double-quoted strings before and after, and counts blocks. The table's header row is not counted. It exits 1 if a polite ending survives in the body, a quote changed, a table cell is not a noun phrase, or the number of blocks differs.
#!/usr/bin/env python3"""usage: check.py before.txt after.txt — endings per region, quotes unchanged, paragraph count"""import re, sys def parts(path): text = open(path, encoding="utf-8").read().strip() quotes = re.findall(r'"[^"\n]*"', text) body, cells = [], [] in_table = False for line in text.splitlines(): s = line.strip() if not s or s.startswith("#") or set(s) <= set("|- "): continue if s.startswith("|"): if in_table: # the first row of a table is the header: skip it cells += [c.strip() for c in s.strip("|").split("|")][1:] # only the right-hand column in_table = True continue in_table = False body.append(re.sub(r'"[^"\n]*"', "", s)) # leave quotes out of the count return text, quotes, body, cells def sentences(lines): out = [] for l in lines: out += [x.strip() for x in re.split(r'(?<=[.!?])\s+', l) if x.strip()] return out def kind(s): if re.search(r'(니다|습니다|십시오|바랍니다)[.!?]?$', s): return "합니다체" if re.search(r'(요|세요)[.!?]?$', s): return "해요체" return "그 밖(명사형 등)" def tally(items): d = {} for s in items: d[kind(s)] = d.get(kind(s), 0) + 1 return d a, b = parts(sys.argv[1]), parts(sys.argv[2])for name, p in (("before", a), ("after ", b)): print(name, "body:", tally(sentences(p[2])), "| table cells:", tally(p[3]))print("quotes unchanged:", a[1] == b[1], f"({len(a[1])} -> {len(b[1])})")print("paragraph blocks:", len(a[0].split("\n\n")), "->", len(b[0].split("\n\n")))ok = (b[1] == a[1] # quotes unchanged and "해요체" not in tally(sentences(b[2])) # no polite endings left in the body and set(tally(b[3])) <= {"그 밖(명사형 등)"} # table cells are all noun phrases and len(a[0].split("\n\n")) == len(b[0].split("\n\n"))) # same number of blockssys.exit(0 if ok else 1)Run against the short-prompt result (with its commentary) and the rules-and-examples result:
$ python3 check.py doc.txt naive.1.out.txt; echo "exit $?"before body: {'합니다체': 8, '해요체': 6} | table cells: {'그 밖(명사형 등)': 2, '해요체': 1, '합니다체': 1}after body: {'합니다체': 17} | table cells: {'그 밖(명사형 등)': 4}quotes unchanged: False (2 -> 3)paragraph blocks: 7 -> 8exit 1$ python3 check.py doc.txt rules.1.out.txt; echo "exit $?"before body: {'합니다체': 8, '해요체': 6} | table cells: {'그 밖(명사형 등)': 2, '해요체': 1, '합니다체': 1}after body: {'합니다체': 14} | table cells: {'그 밖(명사형 등)': 4}quotes unchanged: True (2 -> 2)paragraph blocks: 7 -> 7exit 0The extra body sentences, the quote count going from 2 to 3 and the extra block in the first run all come from the commentary the model added. The labels are Korean because the script classifies Korean endings: 합니다체 is the formal style, 해요체 the polite one, 그 밖 means "other" (noun phrases and so on).
Where it goes wrong
- What counts as a noun-phrase ending is a team decision. "제한함" and "제한" both appeared across runs. Show one example per ending you accept.
- A rule about one ending can leak into neighbors. See the "정리해 보세요" case above.
- The script is a counter, not a grammar checker. A noun ending in 요 is counted as polite, and a sentence ending in an ellipsis falls into "other".
- Long documents. Five paragraphs came back complete. With dozens of paragraphs, run the same prompt and script on chunks.
When not to use it
Do not let AI convert the endings of laws, terms of service or contracts wholesale. The difference between ~할 수 있다 ("may") and ~하여야 한다 ("must") is a difference in obligation, not tone, and the script cannot see it.