มอดูล:sl-common
หน้าตา
- This มอดูล lacks a documentation subpage. Please create it.
- Useful links: subpage list • links • transclusions • testcases • sandbox
local export = {}
function export.has_accents(word)
if mw.ustring.find(mw.ustring.lower(word), "[áéíóúŕàèìòùêô]") then
return true
else
return false
end
end
function export.remove_accents(text)
return require("Module:languages").getByCode("sl"):makeEntryName(text)
end
function export.is_soft(stem)
if mw.ustring.find(stem, "[cjčšž]$") then
return true
else
return false
end
end
function export.first_palat(stem)
if stem:sub(-2) == "k" then return stem:sub(1, -2) .. "č"
elseif stem:sub(-2) == "g" then return stem:sub(1, -2) .. "ž"
elseif stem:sub(-3) == "sk" then return stem:sub(1, -3) .. "šč"
else return stem
end
end
function export.second_palat(stem)
if stem:sub(-2) == "k" then return stem:sub(1, -2) .. "c"
elseif stem:sub(-2) == "g" then return stem:sub(1, -2) .. "z"
else return stem
end
end
function export.iotation(stem)
if stem:sub(-2) == "t" or stem:sub(-2) == "k" or stem:sub(-2) =="c" then return stem:sub(1, -2) .. "č"
elseif stem:sub(-2) == "g" or stem:sub(-2) == "z" then return stem:sub(1, -2) .. "ž"
elseif stem:sub(-3) == "sk" then return stem:sub(1, -3) .. "sk"
elseif stem:sub(-2) == "s" then return stem:sub(1, -2) .. "s"
elseif stem:sub(-2) == "d" then return stem:sub(1, -2) .. "j"
elseif stem:sub(-2) == "m" then return stem:sub(1, -2) .. "mlj"
elseif stem:sub(-2) == "p" then return stem:sub(1, -2) .. "plj"
elseif stem:sub(-2) == "b" then return stem:sub(1, -2) .. "blj"
elseif stem:sub(-2) == "v" then return stem:sub(1, -2) .. "vlj"
elseif stem:sub(-3) == "sl" then return stem:sub(1, -3) .. "šlj"
else return stem
end
end
return export