182
edits
No edit summary |
No edit summary |
||
Line 116: | Line 116: | ||
index = 1 | index = 1 | ||
for i,val in ipairs(result) do | for i,val in ipairs(result) do | ||
-- look through word and replace the correct .'s with ˌ's | -- look through word and replace the correct .'s with ˌ's | ||
if (i == 1) and val == "." and newStresses[1] == "." then | if (i == 1) and val == "." and newStresses[1] == "." then | ||
index = index + 1 | index = index + 1 | ||
elseif val == "." or val == "ˈ" then | elseif val == "." or val == "ˈ" then | ||
table.insert(newWord, | table.insert(newWord, newStresses[index]) | ||
index = index + 1 | index = index + 1 | ||
-- allophonic rules, i.e., from a one-to-one phonemic map to a one-to- | -- allophonic rules, i.e., from a one-to-one phonemic map to a one-to- | ||
-- one phonetic map: vowels first | -- one phonetic map: vowels first | ||
elseif val == "a" then | elseif val == "a" then | ||
if | if newStresses[index-1] == "." then | ||
table.insert(newWord, "w") | table.insert(newWord, "w") | ||
else | else | ||
Line 132: | Line 131: | ||
end | end | ||
elseif val == "e" then | elseif val == "e" then | ||
if | if newStresses[index-1] == "." then | ||
if result[i+1] ~= nil then | if result[i+1] ~= nil then | ||
if mw.ustring.match(result[i+1], "[ntzdr]") then | if mw.ustring.match(result[i+1], "[ntzdr]") then |
edits