Module:semaphore

Hello, you have come here looking for the meaning of the word Module:semaphore. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:semaphore, but we will also tell you about its etymology, its characteristics and you will know how to say Module:semaphore in singular and plural. Everything you need to know about the word Module:semaphore you have here. The definition of the word Module:semaphore will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:semaphore, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

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