Module:category tree/fam/jpx/what-categorizes-msg
- The following documentation is generated by Template:category tree data submodule documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
This data submodule defines part of Wiktionary's category structure.
For an introduction to the category tree system and a description of how to add or modify categories, see Module:category tree/documentation.
local export = {}
local m_str_utils = require("Module:string utilities")
local d_range = mw.loadData("Module:ja/data/range")
-- Handles the "Terms are placed in this category..." text in Japanese affix categories
-- Used in
-- [[Module:category tree/affixes and compounds]]
-- [[Module:category tree/fam/jpx]]
function export.get_what_categorizes_msg(affix, affix_reading, affix_type)
if not affix_reading then
if m_str_utils.find(affix, "[" .. d_range.kanji .. "々〻]") then
--Category has kanji but no reading "read as"
return nil
end
affix_reading = affix
end
local tl
if affix_type == "suffix" then
tl = "{{tl|ja-compound|<var>|...|</var>|" .. affix .. "|-" .. affix_reading .. "}}"
elseif affix_type == "prefix" then
tl = "{{tl|ja-compound|" .. affix .. "|" .. affix_reading .. "-|<var>|...|</var>}}"
elseif affix_type == "infix" then
tl = "{{tl|ja-compound|<var>|...|</var>|" .. affix .. "|-" .. affix_reading .. "-|<var>|...|</var>}}"
end
if tl then
tl = "Terms are placed in this category using " .. tl .. "."
end
return tl
end
return export