Module:User:Suzukaze-c/Hani-tab/ko

local export = {}

--[==[ (shouldn't $kanji be searched for within $text?) ]==] function export.hanja_grade(hanja) local ko_data = require('Module:ko/data') local grades = { 'junghak', 'gohak' }
 * cf. Module:ja.kanji_grade
 * (the implementation of .kanji_grade seem strange to me...)
 * XXX: might belong in Module:ko

for i, grade in ipairs(grades) do		if mw.ustring.match(ko_data[grade], hanja) then return grade end end

return '-' -- XXX: ??? end

function export.main(data) local tab_row_b = mw.html.create('tr') :done

for _, char in ipairs(data.chars) do		tab_row_b :tag('td') -- XXX: なんとなくいまいち :wikitext(' ' .. export.hanja_grade(char) .. ' ') :done :done end

data.hani_tab :node(tab_row_b) :done

return data.hani_tab end

return export