11,840
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 22: | Line 22: | ||
local register = {["colloquial"] = "colloquial", ["formal"] = "formal", ["humorous"] = "humorous"} | local register = {["colloquial"] = "colloquial", ["formal"] = "formal", ["humorous"] = "humorous"} | ||
local dialect = {["hjádvanþs"] = "hjádvanþs", ["coastal"] = "coastal", ["insular"] = "insular"} | local dialect = {["hjádvanþs"] = "hjádvanþs", ["coastal"] = "coastal", ["insular"] = "insular"} | ||
-- create data arrays -- | -- create data arrays -- | ||
Line 59: | Line 52: | ||
local working_syllables = "" | local working_syllables = "" | ||
local manual_entry = false | local manual_entry = false | ||
-- account for acronyms | |||
if mw.ustring.find(word, "[A-ZÀÁẢÂÈÌÍỈÒØÙÛÚỦÝỶỲŪ][A-ZÀÁẢÂÈÌÍỈÒØÙÛÚỦÝỶỲŪ]+") then | |||
syllables_no_auto = true | |||
end | |||
-- turn off rhymes if affix | -- turn off rhymes if affix | ||
Line 66: | Line 64: | ||
local function insert_rhyme(input, pos) | local function insert_rhyme(input, pos) | ||
if show_rhymes then | |||
local function insert_to_rhymes(rhyme) | |||
if not (rhyme == nil or m_table.contains(rhymes, rhyme)) then | |||
if pos == nil then | |||
table.insert(rhymes, rhyme) | |||
else | |||
table.insert(rhymes, pos, rhyme) | |||
pos = pos + 1 | |||
end | |||
-- mw.log("Rhyme registered: " .. rhyme) | |||
end | |||
end | |||
insert_to_rhymes(m_rad_IPA.get_rhyme(input)) | |||
local weak_rhymes = m_rad_IPA.get_weak_rhyme(input) | |||
if weak_rhymes ~= nil and type(weak_rhymes) == "table" then | |||
for _, weak_rhyme in ipairs(weak_rhymes) do | |||
insert_to_rhymes(weak_rhyme) | |||
end | |||
end | |||
end | end | ||
end | end | ||
Line 112: | Line 115: | ||
elseif args[i] ~= nil then | elseif args[i] ~= nil then | ||
local temp_arg = args[i] | local temp_arg = args[i] | ||
temp_arg = mw.ustring.gsub(temp_arg, "%*%(''(.*)''%)%*", "(%1)") | |||
local temp_note = mw.ustring.match(temp_arg, "%s*%*?%(.*%)%*?%s*") | |||
if temp_note then | |||
temp_arg = mw.ustring.gsub(temp_arg, "%s*%*?%(.*%)%*?%s*", "") | |||
temp_note = mw.ustring.match(temp_note, "%((.*)%)") | |||
end | |||
if not mw.ustring.find(temp_arg, "%/(.*)%/") then | if not mw.ustring.find(temp_arg, "%/(.*)%/") then | ||
Line 145: | Line 155: | ||
end | end | ||
if temp_note then | |||
temp_arg = temp_arg .. " *(''" .. temp_note .. "'')*" | |||
end | |||
table.insert(IPA[mode_dialect][mode_register], temp_arg) | table.insert(IPA[mode_dialect][mode_register], temp_arg) | ||
-- mw.log("IPA: added '" .. temp_arg .. "' to IPA[" .. mode_dialect .. "][" .. mode_register .. "]") | -- mw.log("IPA: added '" .. temp_arg .. "' to IPA[" .. mode_dialect .. "][" .. mode_register .. "]") | ||
Line 181: | Line 195: | ||
end | end | ||
-- get automations -- | |||
local auto_IPA = IPA_no_auto == false and m_rad_IPA.generate({word}) | |||
local auto_IPA_phon = IPA_no_auto == false and m_rad_IPA.generate({word, "phon"}) | |||
local auto_IPA_hj = IPA_no_auto == false and m_rad_IPA.generate({word, "hj"}) | |||
local auto_IPA_phon_hj = IPA_no_auto == false and m_rad_IPA.generate({word, "hj", "phon"}) | |||
local auto_syllables = syllables_no_auto == false and m_rad_syllables.generate({word}) | |||
-- add auto values -- | -- add auto values -- |