삭제는 사용자들의 토론에 따라 결정됩니다.
다른 의견이 있으면 틀을 {{삭제보류}}로 바꿔 달아주시고, 토론 문서에서 문서의 삭제에 관해 토론해주세요.
삭제는 사용자들의 토론에 따라 결정됩니다.
다른 의견이 있으면 틀을 {{삭제보류}}로 바꿔 달아주시고, 토론 문서에서 문서의 삭제에 관해 토론해주세요.
연습장이나 사용자 문서에서 틀의 사용이나 수정을 연습할 수 있습니다.
분류는
/설명문서에 넣어주세요.
local jp = { }
function jp.postposition (termination, conjugation) --조사
if (termination == "く") or (termination == "す") or (termination == "る") or (termination == "う") or (termination == "つ") then
return conjugation
else
if conjugation == "て" then return "で"
elseif conjugation == "ます" then return "ます"
elseif conjugation == "た" then return "だ"
else return "ない" end
end
end
function jp.converter(termination, conjugation)
if "く" == termination then
if conjugation == "て" or conjugation == "た" then return "い"
elseif conjugation == "ます" then return "き"
else return "か" end
elseif "ぐ" == termination then
if conjugation == "て" or conjugation == "た" then return "い"
elseif conjugation == "ます" then return "ぎ"
else return "が" end
elseif "す" == termination then
if conjugation == "て" or conjugation == "た" then return "し"
elseif conjugation == "ます" then return "し"
else return "さ" end
elseif "ぬ" == termination then
if conjugation == "て" or conjugation == "た" then return "ん"
elseif conjugation == "ます" then return "に"
else return "な" end
elseif "ぶ" == termination then
if conjugation == "て" or conjugation == "た" then return "ん"
elseif conjugation == "ます" then return "び"
else return "ば" end
elseif "む" == termination then
if conjugation == "て" or conjugation == "た" then return "ん"
elseif conjugation == "ます" then return "み"
else return "ま" end
elseif "る" == termination then
if conjugation == "て" or conjugation == "た" then return "っ"
elseif conjugation == "ます" then return "り"
else return "ら" end
elseif "う" == termination then
if conjugation == "て" or conjugation == "た" then return "っ"
elseif conjugation == "ます" then return "い"
else return "わ" end
elseif "つ" == termination then
if conjugation == "て" or conjugation == "た" then return "っ"
elseif conjugation == "ます" then return "ち"
else return "た" end
else
end
end
function jp.main(frame)
local kanji = frame.args['kanji'] --"遊" --한자
local furigana = frame.args['furigana'] -- "あそ" --후리가나
local hiragana = frame.args['hiragana'] -- "あそぶ" --히라가나
local conjugation = frame.args['conjugation'] --"て" --활용
local verb_g = frame.args['verb_group']
local termination --"" --어미
local okurigana --"" --오쿠리가나
if (kanji == "来") then
if conjugation == "ない" then
furigana = "こ"
else
furigana = "き"
end
rubi = "<ruby><rb>"..kanji..[[</rb><rt style{{=}}"font-size: 70%">]]..furigana.."</rt></ruby>"
return rubi..conjugation
elseif verb_g == 1 then
local temp = string.gsub(string.gsub( hiragana, furigana, "" ), "る", "")
if conjugation == "て" then temp = temp.."て"
elseif conjugation == "ます" then temp = temp.."ます"
elseif conjugation == "た" then temp = temp.."た"
else temp = temp.."ない" end
return "<ruby><rb>"..kanji..[[</rb><rt style{{=}}"font-size: 70%">]]..furigana.."</rt></ruby>"..temp
elseif hiragana == 2 and furigana == 1 then
termination = string.gsub( hiragana, furigana, "" )
rubi = "<ruby><rb>"..kanji..[[</rb><rt style{{=}}"font-size: 70%">]]..furigana.."</rt></ruby>"
return rubi..jp.converter(termination, conjugation)..jp.postposition(termination, conjugation)
else
okurigana = string.gsub( hiragana, furigana, "" )
if string.len( okurigana ) > 1 then
termination = string.sub( okurigana, 0, - 1)
else
termination = okurigana
end
rubi = "<ruby><rb>"..kanji..[[</rb><rt style{{=}}"font-size: 70%">]]..furigana.."</rt></ruby>"
return rubi..jp.converter(termination, conjugation)..jp.postposition(termination, conjugation)
end
end
return jp