48,355
edits
No edit summary |
No edit summary |
||
| Line 17: | Line 17: | ||
local gsplit = mw.text.gsplit | local gsplit = mw.text.gsplit | ||
local PAGENAME = mw. | local PAGENAME = mw.loadData("Module:headword/data").pagename | ||
local NAMESPACE = mw.title.getCurrentTitle().nsText | --local NAMESPACE = mw.title.getCurrentTitle().nsText | ||
local vowels = "aeiouyůảẻỉỏủỷ" | local vowels = "aeiouyůảẻỉỏủỷ" | ||
| Line 60: | Line 60: | ||
end | end | ||
local function detect_decl(word, | local function detect_decl(word, schiz) | ||
local syllabified = m_pron.syllabify_from_spelling(word) | local syllabified = m_pron.syllabify_from_spelling(word) | ||
--syllabified = gsub(syllabified, "·(" .. consonants .. ")%1", "%1·%1") | --syllabified = gsub(syllabified, "·(" .. consonants .. ")%1", "%1·%1") | ||
| Line 86: | Line 86: | ||
if m_data.teleutophonic_ending(word) then | if m_data.teleutophonic_ending(word) then | ||
return "teleutophonic-" .. teleuphonic_ending | return "teleutophonic-" .. teleuphonic_ending | ||
elseif syll_count == 1 then | elseif syll_count == 1 then --monosyllabic | ||
-- "There is unfortunately no way to tell whether a monosyllabic noun ending in a consonant belongs to | -- "There is unfortunately no way to tell whether a monosyllabic noun ending in a consonant belongs to | ||
-- the consonantal declension group of the schizaphonic declension group" (p. 119) | -- the consonantal declension group of the schizaphonic declension group" (p. 119) | ||
if phoniticy == "consonantal" then | if phoniticy == "consonantal" then | ||
if args.schiz ~= nil then | if args.schiz ~= nil then | ||
return "monosyllabic-" .. ( | return "monosyllabic-" .. (schiz .. "schizophonic" or "consonantal") | ||
else | else | ||
error(word .. " is a monosyllabic noun ending in a consonant. Disambiguation needed between consonantal and schizophonic declensions.") | error(word .. " is a monosyllabic noun ending in a consonant. Disambiguation is needed between consonantal and schizophonic declensions.") | ||
end | end | ||
else | |||
return "monosyllabic-diphthongal-" .. phonicity | |||
end | end | ||
else | else | ||
| Line 107: | Line 108: | ||
local organicity = poa_onset and (poa_onset == poa_coda and "homorganic" or "heterorganic") or nil | local organicity = poa_onset and (poa_onset == poa_coda and "homorganic" or "heterorganic") or nil | ||
if syll_count == 2 then --bisyllabic | |||
return "bisyllabic-" .. (phonicity == "consonantal" and phonicity or aphonicity .. "-" .. (onset and organicity .. "-" or "") .. phonicity) | |||
elseif syll_count == 3 then --trisyllabic | |||
end | |||
end | end | ||
end | end | ||
| Line 115: | Line 118: | ||
-- The main entry point. | -- The main entry point. | ||
function export.show(frame) | function export.show(frame) | ||
local params = { | |||
[1] = {default = pagename, template_default = "goka"}, | |||
["decl"] = {}, | |||
["schiz"] = {}, | |||
} | |||
local parent_args = frame:getParent().args | local parent_args = frame:getParent().args | ||
local args = require("Module:parameters").process(parent_args, params) | |||
local data = {} | |||
data.decl = args.decl or detect_decl(args[1], args.schiz) | |||
-- make the table | -- make the table | ||
| Line 122: | Line 135: | ||
local function make_table(data) | local function make_table(data) | ||
return data.decl | |||
end | end | ||
return export | return export | ||