10,794
edits
TheNightAvl (talk | contribs) (Added more vowel resolution) |
TheNightAvl (talk | contribs) (Vowel resolution near completion) |
||
Line 1: | Line 1: | ||
--[[ | |||
Debug console test string: | |||
=p.generate(mw.getCurrentFrame():newChild{title="whatever",args={"rjaovs"}}) | |||
]] | |||
local export = {} | local export = {} | ||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
Line 279: | Line 284: | ||
mw.log("————— BEGINNING VOWEL RESOLUTION —————") | mw.log("————— BEGINNING VOWEL RESOLUTION —————") | ||
local i = 0 | |||
while true do | |||
i = i + 1 | |||
local p_prev3 = working_phones[i - 3] | local p_prev3 = working_phones[i - 3] | ||
local p_prev2 = working_phones[i - 2] | local p_prev2 = working_phones[i - 2] | ||
Line 288: | Line 295: | ||
local p_next3 = working_phones[i + 3] | local p_next3 = working_phones[i + 3] | ||
local toResolve = false | local toResolve = false | ||
if p_current == nil then break end | |||
local function p_Resolve(p_new) | local function p_Resolve(p_new) | ||
Line 348: | Line 357: | ||
end | end | ||
if vowel[p_next] then | |||
-- RESOLUTION OF PREVOCALIC <iej>, <uoj> and <yej> -- | |||
if p_current == "iej" or p_current == "yej" or p_current == "uoj" then | if p_current == "iej" or p_current == "yej" or p_current == "uoj" then | ||
Line 356: | Line 365: | ||
if p_current == "uoj" then | if p_current == "uoj" then | ||
p_Resolve("uo") | p_Resolve("uo") | ||
table.insert(working_phones, i + 1, "j") | |||
mw.log("[j] inserted to position " .. i + 1 .. ".") | |||
else | else | ||
p_Convert("ie") | |||
end | end | ||
end | end | ||
-- RESOLUTION OF PREVOCALIC [ie] and [uo] -- | |||
if p_current == "ie" then | |||
p_Resolve("iː") | |||
elseif p_current == "uo" then | |||
p_Resolve("uː") | |||
end | |||
else | else | ||
-- RESOLUTION OF NON-PREVOCALIC <iej>, <uoj> and <yej> -- | |||
if p_current == "iej" then | if p_current == "iej" then |