Module:lfv-IPA: Difference between revisions

m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
mNo edit summary
Line 63: Line 63:
[" "] = " ",
[" "] = " ",
["."] = "|",
["."] = "|",
--[[change the character you want to use to mark secondary stress in the input→]] ["_"] = "ˌ",
}
}
data[","] = data["."]
data[","] = data["."]
Line 169: Line 171:
end
end
-- resolve consonants --
local i = 1
local i = 1
local secondary_stress = {}
while working_IPA[i] do
if working_IPA[i] == "ˌ" then
table.insert(secondary_stress, i)
table.remove(working_IPA, i)
i = i - 1
end
i = i + 1
end
-- resolve --
i = 1
while working_IPA[i] do
while working_IPA[i] do
Line 190: Line 205:
table.remove(working_IPA, i+1)
table.remove(working_IPA, i+1)
p_next = working_IPA[i+1]
p_next = working_IPA[i+1]
for index, position in ipairs(secondary_stress) do
if position > i + 1 then
secondary_stress[index] = secondary_stress[index] - 1
end
end
end
end
end
end
Line 221: Line 241:
if vowel[working_IPA[i-2]] and (p_prev == "i" or p_prev == "u") then
if vowel[working_IPA[i-2]] and (p_prev == "i" or p_prev == "u") then
table.remove(working_IPA, i)
table.remove(working_IPA, i)
for index, position in ipairs(secondary_stress) do
if position > i then
secondary_stress[index] = secondary_stress[index] - 1
end
end
working_IPA[i-2] = working_IPA[i-2] .. "ː"
working_IPA[i-2] = working_IPA[i-2] .. "ː"
p_current = working_IPA[i]
p_current = working_IPA[i]
Line 300: Line 325:
i = i + 1
i = i + 1
end
-- secondary stress --
if phon then
while secondary_stress[1] do
table.insert(working_IPA, secondary_stress[1], "ˌ")
table.remove(secondary_stress,1)
for no, value in ipairs(secondary_stress) do
secondary_stress[no] = value - 1
end
end
end
end