Module:qlu-pron: Difference between revisions
No edit summary |
Tag: Undo |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 207: | Line 207: | ||
local syllables = split(word, "·"); | local syllables = split(word, "·"); | ||
if no_stress | if no_stress or (#syllables == 1 and not match(word, "[" .. c.acute .. c.circ .. "]")) then | ||
return dediacv(word, "[" .. c.acute .. c.circ .. "]") | |||
end | |||
local first_stress = "[âêîôû]" | local first_stress = "[âêîôû]" | ||
| Line 237: | Line 238: | ||
end | end | ||
function export.crux(term, no_stress) | function export.crux(term, no_stress, outputs) | ||
local ret, dialects = {}, {} | local ret, dialects = {}, {} | ||
term = mw.ustring.lower(term) | term = mw.ustring.lower(term) | ||
| Line 284: | Line 285: | ||
end | end | ||
if outputs then | |||
-- testcases | -- testcases | ||
if outputs == "phonemic" then | if outputs == "phonemic" then | ||
| Line 293: | Line 294: | ||
return "/" .. phonemic .. "/ [" .. phonetic .. "]" | return "/" .. phonemic .. "/ [" .. phonetic .. "]" | ||
end | end | ||
end | end | ||
dialects["paulistan"] = paulistan | dialects["paulistan"] = paulistan | ||
| Line 342: | Line 343: | ||
end | end | ||
else | else | ||
return export.crux(term) | return export.crux(term, no_stress) | ||
end | end | ||
| Line 351: | Line 352: | ||
local parent_args = frame:getParent().args | local parent_args = frame:getParent().args | ||
local params = { | local params = { | ||
[1] = { default = mw.title.getCurrentTitle(). | [1] = { | ||
default = mw.title.getCurrentTitle().text, | |||
template_default = "agghiu" | |||
}, | |||
["rs"] = {type = 'boolean'}, | ["rs"] = {type = 'boolean'}, | ||
} | } | ||