모듈:한글조합 문서 원본 보기
보이기
← 모듈:한글조합
문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
문서의 원본을 보거나 복사할 수 있습니다.
local p = {}
function p.typ(frame)
local han = mw.text.jsonDecode(frame:expandTemplate{title = '모듈:한글조합/변환'})
local text = frame.args[1]
local key = frame.args[2]
local last = text:sub(-3)
local left = text:sub(1, -4)
local keycode = mw.ustring.codepoint(key)
local lastcode = mw.ustring.codepoint(last)
if (last) then
if (0x3131 <= lastcode and lastcode <= 0x314E) then -- 자음
if (0x314F <= keycode and keycode <= 0x3163) then -- 모음
return left .. han.letter.cho[last] .. han.letter.jung[key] -- 초성 .. 중성
else return text .. key end
elseif (0x1161 <= lastcode and lastcode <= 0x1175) then -- 중성
if (0x314F <= keycode and keycode <= 0x3163) then -- 모음
return left .. (han.letter.jung[last .. key] or last .. key) -- 중성 or 중성 .. 모음
000
1:0
이 문서에서 사용한 틀:
- 틀:틀 설명문서 (원본 보기)
- 모듈:Arguments (원본 보기)
- 모듈:Category handler (원본 보기) (준보호됨)
- 모듈:Category handler/blacklist (원본 보기)
- 모듈:Category handler/config (원본 보기)
- 모듈:Category handler/data (원본 보기)
- 모듈:Category handler/shared (원본 보기)
- 모듈:Documentation (원본 보기)
- 모듈:Documentation/config (원본 보기)
- 모듈:Message box (원본 보기)
- 모듈:Message box/configuration (원본 보기)
- 모듈:Message box/localize (원본 보기)
- 모듈:Namespace detect/config (원본 보기)
- 모듈:Namespace detect/data (원본 보기)
- 모듈:No globals (원본 보기)
- 모듈:Yesno (원본 보기)
- 모듈:한글조합/설명문서 (원본 보기)
모듈:한글조합 문서로 돌아갑니다.