Definition from Wiktionary, the free dictionary
Jump to: navigation, search
This does all of the work of {{ja-usex}}. It displays and example or quote like {{usex}}, but unlike usex it adds furigana to the example and generates the romanization to be used as the transliteration comprising the second line of the quote or example.
local m_ja = require("Module:ja")
local export = {}
-- main entry point
	local args = frame:getParent().args
	local text = {}
	local example = args[1] or error("Example has not been specified. Please pass parameter 1 to the module invocation.")
	local second_param = args[2] or error("A kana form or a translation must be passed in parameter 2.")
	-- if user only specified two params, assume second param is translation, first param has no kanji
	local translation = args[3] or "" 
	local kana = ""
	if translation == "" then 
		translation = second_param
		kana = example
		kana = second_param
	table.insert(text, ('<span lang="ja" class="Jpan">%s</span>'):format(m_ja.add_ruby_backend(example, kana)))
	table.insert(text, "<dl><dd>''")
	-- capitalize first letter if last letter ends in period, question mark, or exclamation point
	if mw.ustring.match(kana, "[。?!]$") then 
		table.insert(text, (mw.ustring.gsub(m_ja.kana_to_romaji(kana), "^%'.-%l", mw.ustring.upper)))
		table.insert(text, m_ja.kana_to_romaji(kana))
	table.insert(text, "''</dd><dd>")
	table.insert(text, translation)
	table.insert(text, "</dd></dl>")
	return table.concat(text)
return export