local export = {}
local flagmap = {
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
= "]",
}
function export.textToImages(text)
text = mw.ustring.gsub(text, "LeftFlag", "")
text = mw.ustring.gsub(text, "RightFlag", "")
text = mw.ustring.gsub(text, "*", flagmap)
return text
end
local parts_of_speech = {
= "letters",
= "syllables",
= "numbers",
= "punctuation marks",
= "symbols",
= "interjections",
}
function export.headword(frame)
local language_code = frame.args
local current_pos = frame.args
local language_object = require("Module:languages").getByCode(language_code)
local sc = require("Module:scripts").getByCode("Semap")
local m_head = require("Module:headword")
local head = frame:getParent().args
if not head or head == "" then
head = mw.title.getCurrentTitle().subpageText
end
local display = '<span style="display:inline-block;vertical-align:middle">' .. export.textToImages(head) .. '</span>'
local data = {lang = language_object, sc = sc, categories = {}, sort_key = head, heads = {display}}
if parts_of_speech then
data.pos_category = parts_of_speech
end
return m_head.full_headword(data)
end
return export