Module:ko-symbol-nav

local m_str_utils = require("Module:string utilities")

local codepoint = m_str_utils.codepoint local concat = table.concat local insert = table.insert local len = m_str_utils.len local u = m_str_utils.char

local export = {}

local function link(char, alt) return  .. (alt or char) ..  end

local function mark(char) return '  .. char ..  ' end

function export.show(frame) local hangul_original = mw.title.getCurrentTitle.text

if len(hangul_original) ~= 1 then return error("Template:ko-symbol-nav is for use on single-Hangul entries.") end

local block_size = 28 local offset = 44032 -- codepoint('가') local hangul_cv_ncr = codepoint(hangul_original) - ((codepoint(hangul_original) - offset) % block_size) local hangul_cv = u(hangul_cv_ncr)

-- Generate the Hangul syllables for the table. local i = 0 local full_hangul_set = { hangul_cv } while i < block_size do		full_hangul_set[i + 1] = u(hangul_cv_ncr + i)		i = i + 1 end

-- Build the table. local table_final = {} insert(table_final, ' ')

return concat(table_final) end

return export