Module:script utilities/data: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
local data = {}
local data = {}


local translit = {
data.translit = {
["term"] = {
["term"] = {
--[=[ can't be done until Kana transliterations are correctly parsed by [[Module:links]]
["tag"] = "i",
["tag"] = "i",
]=]
["classes"] = "mention-tr",
["class"] = "mention-tr",
},
},
["usex"] = {
["usex"] = {
["tag"] = "i",
["tag"] = "i",
["class"] = "e-transliteration",
["classes"] = "e-transliteration",
},
},
["head"] = {
["head"] = {
["class"] = "headword-tr",
["classes"] = "headword-tr",
["dir"] = "ltr",
["dir"] = "ltr",
},
},
["default"] = {},
["default"] = {},
}
}
for _, v in next, translit do
if not v.tag then
v.tag = "span"
end
end
data.translit = translit


data.transcription = {
data.transcription = {
["head"] = {
["head"] = {
["tag"] = "span",
["tag"] = "span",
["class"] = "headword-ts",
["classes"] = "headword-ts",
["dir"] = "ltr",
["dir"] = "ltr",
},
},
["usex"] = {
["usex"] = {
["tag"] = "span",
tag = "span",
["class"] = "e-transcription",
["classes"] = "e-transcription",
},
},
["default"] = {},
["default"] = {},
}
}


data.definition = {
for key, value in pairs(data.translit) do
["gloss"] = {
if not value.tag then
["tag"] = "span",
value.tag = "span"
["class"] = "mention-gloss",
end
},
end
 
local faces = {}


["non-gloss"] = {
faces["term"] = {
["tag"] = "span",
tag = "i",
["class"] = "use-with-mention",
class = "mention",
},
}
}


local faces = {
faces["head"] = {
["term"] = {
tag = "strong",
["tag"] = "i",
class = "headword",
["class"] = "mention",
}
},


["head"] = {
faces["hypothetical"] = {
["tag"] = "strong",
prefix = '<span class="hypothetical-star">*</span>',
["class"] = "headword",
tag = "i",
},
class = "hypothetical",
}


["hypothetical"] = {
faces["bold"] = {
["prefix"] = '<span class="hypothetical-star">*</span>',
tag = "b",
["tag"] = "i",
}
["class"] = "hypothetical",
},


["bold"] = {
faces["plain"] = {
["tag"] = "b",
tag = "span",
},
 
["plain"] = {
["tag"] = "span",
}
}
}



Revision as of 09:27, 5 April 2025



local data = {}

data.translit = {
	["term"] = {
		["tag"] = "i",
		["classes"] = "mention-tr",
	},
	["usex"] = {
		["tag"] = "i",
		["classes"] = "e-transliteration",
	},
	["head"] = {
		["classes"] = "headword-tr",
		["dir"] = "ltr",
	},
	["default"] = {},
}

data.transcription = {
	["head"] = {
		["tag"] = "span",
		["classes"] = "headword-ts",
		["dir"] = "ltr",
	},
	["usex"] = {
		tag = "span",
		["classes"] = "e-transcription",
	},
	["default"] = {},
}

for key, value in pairs(data.translit) do
	if not value.tag then
		value.tag = "span"
	end
end

local faces = {}

faces["term"] = {
	tag = "i",
	class = "mention",
}

faces["head"] = {
	tag = "strong",
	class = "headword",
}

faces["hypothetical"] = {
	prefix = '<span class="hypothetical-star">*</span>',
	tag = "i",
	class = "hypothetical",
}

faces["bold"] = {
	tag = "b",
}

faces["plain"] = {
	tag = "span",
}

faces["translation"] = faces["plain"]

data.faces = faces

return data