Module:IPAc2-mh: Difference between revisions

Content deleted Content added
m Protected "Module:IPAc2-mh": match protection on Template:IPAc2-mh per WP:RFPP ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefinite))
No edit summary
Line 1:
-- This module is primarily maintained at:
-- https://en.wiktionary.org/wiki/Module:mh-pronunc
 
local MERGED_VOWELS = false
local PHONETIC_DETAILS = false
local SPECIAL_EPENTHESIS = true
local W_OFF_GLIDES = true
 
local export = {}
 
local math_max = math.max
local mw_text_gsplit = mw.text.gsplit
local mw_text_split = mw.text.split
local mw_text_trim = mw.text.trim
local mw_ustring_gsub = mw.ustring.gsub
local mw_ustring_lower = mw.ustring.lower
local string_byte = string.byte
local string_find = string.find
local string_gmatch = string.gmatch
local string_gsub = string.gsub
local string_lower = string.lower
local string_sub = string.sub
local table_concat = table.concat
local table_remove = table.remove
 
local ASYLL = "̯"
Line 49 ⟶ 69:
return ""
else
local atLeft = string.bytestring_byte(text) == 32
local atRight = string.bytestring_byte(text, -1) == 32
if atLeft then
if atRight then
return string.substring_sub(text, 2, -2)
else
return string.substring_sub(text, 2)
end
elseif atRight then
return string.substring_sub(text, 1, -2)
else
return text
Line 67 ⟶ 87:
local function parseBoolean(text)
if type(text) == "string" then
text = string.gsubstring_gsub(text, "[^0-9A-Za-z]", "")
if text ~= "" and text ~= "0" and string.lowerstring_lower(text) ~= "false" then
return true
end
Line 78 ⟶ 98:
chars = chars or {}
local index = 1
for ch in string.gmatchstring_gmatch(text, pattern or UTF8_CHAR) do
chars[index] = ch
index = index + 1
Line 84 ⟶ 104:
if index <= #chars then
if shorten then
table.removetable_remove(chars, index)
else
repeat
Line 96 ⟶ 116:
 
local function string_gsub2(text, pattern, subst)
return string.gsubstring_gsub(string.gsubstring_gsub(text, pattern, subst), pattern, subst)
end
 
Line 122 ⟶ 142:
local function ZTBL(text, sep)
local tbl = {}
for key in mw.text.gsplitmw_text_gsplit(text, sep or " ") do
tbl[key] = true
end
Line 137 ⟶ 157:
local outSeq = {}
code = mw.ustring.gsubmw_ustring_gsub(code, "%s+", " ")
code = string.lowerstring_lower(code)
for text in mw.text.gsplitmw_text_gsplit(code, " *,[ ,]*") do
text = fastTrim(text)
if text ~= "" then
local temp = string.gsubstring_gsub(text, "[abdeghijklmnprtwy_&'%- ]", "")
if temp ~= "" then
error("'"..code.."' contains unsupported characters: "..temp)
Line 153 ⟶ 173:
["y"] = "0", ["h"] = "0h", ["w"] = "0w"
}
text = string.gsubstring_gsub(text, "_*([hwy])_+", PARSE_PSEUDO_GLIDE)
text = string.gsubstring_gsub(text, "_+([hwy])", PARSE_PSEUDO_GLIDE)
if string.findstring_find(text, "_") then
error("contains misplaced underscores: "..code)
end
-- a plain {i} protected from dialect-specific reflexes
text = string.gsubstring_gsub(text, "'i", "I")
-- "yi'y" and "'yiy" sequences
text = string.gsubstring_gsub(text, "('?)yi('*)y", function(aposA, aposB)
if aposA ~= "" then
-- "dwelling upon" i
Line 197 ⟶ 217:
["0w"] = "_W"
}
text = string.gsubstring_gsub(text, "[klmnr0]g?[hw]?", PARSE_C_CH_CW)
if string.findstring_find(text, "g") then
error("contains g that is not part of ng: "..code)
end
Line 220 ⟶ 240:
["'"] = ""
}
text = string.gsubstring_gsub(text, ".", PARSE_REMAINING)
-- Enforce CVC, CVCVC, CVCCVC, etc. phonotactics,
-- but allow VC, CV at affix boundaries
-- where a vowel may link to another morpheme's consonant.
temp = string.gsubstring_gsub(text, "[%s%-]+", "")
if string.findstring_find(temp, "_..[jGw]") or
string.findstring_find(temp, ".[jGw]_.")
then
error("pseudo-glides may not neighbor a consonant")
end
if string.findstring_find(temp, VI.."_."..VI) then
error("pseudo-glides may only be at the beginning or end"..code)
end
if string.findstring_find(temp, VI..VI) then
error("vowels must be separated by a consonant: "..code)
end
if string.findstring_find(temp, ".[jGw].[jGw].[jGw]") then
error("each consonant cluster is limited to two: "..code)
end
if string.findstring_find(temp, ".[jGw].[jGw]$") then
error("may not end with a consonant cluster: "..code)
end
string.gsubstring_gsub(temp, "^(.[jGw])(.[jGw])", function(consonX, consonY)
if consonX ~= consonY then
error("may only begin with single or geminated consonant: "
Line 325 ⟶ 345:
local version = args and args.version
local map = BENDER_MAPS[
type(version) == "string" and string.lowerstring_lower(version) or ""
] or BENDER_DEFAULT
local outSeq = {}
for _, text in pairs(inSeq) do
text = string.gsubstring_gsub(text, ".[jGw]?", map)
addUnique(outSeq, text)
end
Line 347 ⟶ 367:
 
local function toMOD(text)
text = mw.ustring.gsubmw_ustring_gsub(text, ".["..CEDILLA..MACRON.."]?", TO_MOD)
return text
end
Line 387 ⟶ 407:
local outSeq = {}
for _, text in pairs(inSeq) do
text = string.gsubstring_gsub(text, ".[jGw]?", PHONEMIC_MAP)
addUnique(outSeq, text)
end
Line 427 ⟶ 447:
local function maxF1(a, b)
if b then
return VOWEL[math.maxmath_max(2, F1[a], F1[b])][F2_FRONT]
else
return VOWEL[math.maxmath_max(2, F1[a])][F2_FRONT]
end
end
Line 436 ⟶ 456:
-- Morphemes can begin with geminated consonants, but spoken words cannot.
text = string.gsubstring_gsub(text, "^(.[jGw])( *)%1( *)("..VI..")",
function(conson, _, __, vowel)
if conson == "hG" then
Line 457 ⟶ 477:
-- To block this in the template argument, use "'i" instead of "i".
text = " "..text
text = string.gsubstring_gsub(text,
"([ jGw])( *)(h[jw])( *)i( *)(h[jw])( *)("..VI..")",
function(nonVowel, _, consonX, __, ___, consonY, ____, vowel)
Line 481 ⟶ 501:
end
)
text = string.substring_sub(text, 2)
-- Restore protected {i}, we won't be checking for it anymore.
text = string.gsubstring_gsub(text, "I", "i")
return text
Line 511 ⟶ 531:
-- and no pseudo-glide, display phrase three times
-- with each of the different pseudo-glides.
if IS_VOWEL[string.substring_sub(text, 1, 1)] then
toPhoneticRemainder("_j"..text, config)
toPhoneticRemainder("_G"..text, config)
Line 517 ⟶ 537:
return
end
if IS_VOWEL[string.substring_sub(text, -1)] then
toPhoneticRemainder(text.."_j", config)
toPhoneticRemainder(text.."_G", config)
Line 558 ⟶ 578:
end
toPhoneticRemainder(code, config)
addUnique(outSeq, table.concattable_concat(subSeq, " ~ "))
config.outSeq = outSeq
config.initialJ = initialJ
Line 569 ⟶ 589:
if not diphthongs then
-- {ww} always causes the second glide to surface.
text = string.gsubstring_gsub(text, "([aEei])( *)hw( *)hw", "%1%2hw%1@%3Hw")
end
text = string.gsubstring_gsub(text, "([aEei])( *)hG( *.[jGw])", "%1%2hG%1@%3")
text = string.gsubstring_gsub(text, "(.[jGw])( *)hG( *)([aEei])", "%1%4@%2hG%3%4")
text = string.gsubstring_gsub(text, "([aEei])( *)h(.)( *.[jGw])", "%1%2h%3%1@%4")
text = string.gsubstring_gsub(text, "(.[jGw])( *)h(. *)([aEei])", "%1%4@%2h%3%4")
text = string.gsubstring_gsub(text, "(.[jGw])( *[yY].)", "%1i@%2")
-- Preserve these exceptionally stable clusters.
text = string.gsubstring_gsub(text, "l([jG] *)tG", "l%1|tG")
-- Unstable consonant clusters trigger epenthesis.
-- Liquids before coronal obstruents.
text = string.gsubstring_gsub(text, "([rl].)( *)t", "%1v%2t")
-- Nasals and liquids after coronal obstruents.
text = string.gsubstring_gsub(text, "t(.)( *[nrl])", "t%1v%2")
-- Heterorganic clusters.
-- Labial consonants neighboring coronal or dorsal consonants.
text = string.gsubstring_gsub(text, "([pm].)( *[tnrlkN])", "%1v%2")
-- Coronal consonants neighboring labial or dorsal consonants.
text = string.gsubstring_gsub(text, "([tnrl].)( *[pmkN])", "%1v%2")
-- Dorsal consonants neighboring labial or coronal consonants.
text = string.gsubstring_gsub(text, "([kN].)( *[pmtnrl])", "%1v%2")
-- Organic speech involves certain consonant cluster assimilations.
Line 603 ⟶ 623:
-- Forward assimilation of rounded consonants.
-- There is no rounded coronal obstruent.
text = string.gsubstring_gsub(text, "(w *[^t])[jG]", "%1w")
-- Backward assimilation of remaining secondary articulations.
text = string.gsubstring_gsub(text, "[jGw]( *.)([jGw])", "%2%1%2")
-- Backward nasal assimilation of primary articulations.
text = string.gsubstring_gsub(text, "[pkrl](. *)([mnN])", "%2%1%2")
-- No longer need to protect exceptionally stable consonant clusters.
text = string.gsubstring_gsub(text, "|", "")
-- Give a vowel height to all epenthetic vowels that still lack one.
Line 622 ⟶ 642:
-- Tag all vowels for next set of operations.
text = string.gsubstring_gsub(text, "([aEei])", "/%1")
-- There is no variation in the surface realizations of vowels
Line 653 ⟶ 673:
-- Represent vowels neighboring pseudo-glides as diphthongs regardless.
text = string.gsubstring_gsub(text,
"(_)([jGw])( *)/([aEei])(@?)( *)(.)([jGw])", subst)
text = string.gsubstring_gsub(text,
"(.)([jGw])( *)/([aEei])(@?)( *)(_)([jGw])", subst)
Line 728 ⟶ 748:
-- Exceptionally for the single word "rej".
text = string.gsubstring_gsub(text, "^(rG *)([V7])( *tj)$",
function(prefix, vowel, suffix)
return prefix..FRONT_VOWEL[vowel]..suffix
Line 736 ⟶ 756:
-- Vowels always claim the secondary articulation
-- of a neighboring back unrounded glide.
text = string.gsubstring_gsub(text, "(hG *)/([aEei])", function(prefix, vowel)
return prefix..BACK_VOWEL[vowel]
end)
text = string.gsubstring_gsub(text, "/([aEei])(@? *hG)", function(vowel, suffix)
return BACK_VOWEL[vowel]..suffix
end)
Line 745 ⟶ 765:
-- Unless already claimed, epenthetic vowels after a glide
-- always claim the secondary articulation to the left.
text = string.gsubstring_gsub(text, "([hH])(.)( *)/([aEei])@",
function(primaryL, secondaryL, _, vowel)
return (
Line 756 ⟶ 776:
-- Unless already claimed, vowels before a glide
-- always claim the secondary articulation to the right.
text = string.gsubstring_gsub(text, "/([aEei])(@?)( *[hHyY])(.)",
function(vowel, epenth, primaryR, secondaryR)
return (
Line 767 ⟶ 787:
-- For now, unless already claimed, vowels before a rounded consonant
-- claim the secondary articulation to the right.
text = string.gsubstring_gsub(text, "/([aEei])(@? *.w)", function(vowel, suffix)
return ROUND_VOWEL[vowel]..suffix
end)
Line 773 ⟶ 793:
-- For now, unless already claimed, remaining vowels
-- claim the secondary articulation to the left.
text = string.gsubstring_gsub(text, "([jGw])( *)/([aEei])",
function(secondaryL, _, vowel)
return secondaryL.._..VOWEL[F1[vowel]][F2[secondaryL]]
Line 784 ⟶ 804:
return prefix..VOWEL[F1[vowel]][F2[secondaryR]]..infix..secondaryR
end
text = string.gsubstring_gsub(text, "([yY]. *)([aEei])(@? *.)([jGw])", subst)
-- Change certain vowels in a special environment from round to front.
text = string.gsubstring_gsub(text, "([hyY]j *)([Oou])( *)(.w)("..V..")",
function(prefix, vowelL, _, conson, vowelR)
if conson ~= "hw" or F1[vowelL] ~= F1[vowelR] then
Line 794 ⟶ 814:
end
)
text = string.gsubstring_gsub(text, "([hyY]j *)([Oou])( *.w *.w)",
function(prefix, vowel, suffix)
return prefix..FRONT_VOWEL[vowel]..suffix
end
)
text = string.gsubstring_gsub(text, "(a@? *hj *)Q( *.w *"..V..")", "%1a%2")
text = string.gsubstring_gsub(text, "(a@? *hj *)Q( *.w *.w)", "%1a%2")
-- Tag certain glide-vowel-non-glide sequences for special reflexes.
text = string.gsubstring_gsub(text, "(H[jw] *)("..V.." *[ptkmnNrl])", "%1/%2")
text = string.gsubstring_gsub(text, "^ *(h[jw] *)("..V.." *[ptkmnNrl])", "%1/%2")
text = string.gsubstring_gsub(text, "(@ *h[jw] *)("..V.." *[ptkmnNrl])", "%1/%2")
text = string.gsubstring_gsub(text,
"([EeiAV7MOou]@? *h[jw] *)([aAQ] *[ptkmnNrl])", "%1/%2")
text = string.gsubstring_gsub(text,
"(hj *[aEei]@? *hw *)("..V.." *[ptkmnNrl])", "%1/%2")
-- Untag certain sequences, exempting them from special reflexes.
text = string.gsubstring_gsub(text, "(hj *)/([aEei] *[knNrl]w)", "%1%2")
-- Special reflexes.
text = string.gsubstring_gsub(text, "([jw])( *)/("..V..")( *)(.)([jGw])",
function(secondaryL, _, vowel, __, primaryR, secondaryR)
return secondaryL.._..
Line 827 ⟶ 847:
-- Temporarily cancel epenthetic {i} neighboring {yi'y}.
text = string.gsubstring_gsub(text, "i@( *yj)", "%1")
-- {yi'y} neighboring {i} may now be demoted to {y}.
text = string.gsubstring_gsub(text, "([iMu]@? *)yj", "%1hj")
text = string.gsubstring_gsub(text, "yj( *[iMu])", "hj%1")
-- {'yiy} may now be demoted everywhere.
text = string.gsubstring_gsub(text, "(i@ *)Yj", "%1hjihj")
text = string.gsubstring_gsub(text, "Yj", "hjihji@hj")
-- For the purposes of this template,
-- surface all glides pronounced in isolation.
text = string.gsubstring_gsub(text, "^ *h(.) *$", "H%1")
if not diphthongs then
-- Opportunistically front this vowel.
text = string.gsubstring_gsub(text,
"hj( *)A( *[kN]G *[kN]?G? *"..V..")", "hj%1a%2")
-- Surface certain glides.
text = string.gsubstring_gsub(text, "^ *h(w *[Oou])", "H%1")
text = string.gsubstring_gsub(text, "h(w *[aEeiAV7M])", "H%1")
text = string.gsubstring_gsub(text, "^ *h(j *[AV7MQOou])", "H%1")
text = string.gsubstring_gsub(text, "([ptkmnNrl]..@ *)h(w *[Oou])", "%1H%2")
text = string.gsubstring_gsub(text,
"([ptkmnNrl].).@( *)h(j *[AV7MQOou])", "%1%2H%3")
text = string.gsubstring_gsub(text, "([AV7MQOou]@? *)h(j *[AV7MQOou])", "%1H%2")
text = string.gsubstring_gsub(text, "([aEeiAV7M])(@? *)hw( *)([QOou])",
function(vowelL, infix, _, vowelR)
if F1[vowelL] > F1[vowelR] then
Line 860 ⟶ 880:
end
)
text = string.gsubstring_gsub(text, "([AV7MQOou])(@? *)hj( *)([aEei])",
function(vowelL, infix, _, vowelR)
if F1[vowelL] > F1[vowelR] then
Line 867 ⟶ 887:
end
)
text = string.gsubstring_gsub(text, "([aEei])(@? *)hj( *)([AV7MQOou])",
function(vowelL, infix, _, vowelR)
if F1[vowelL] < F1[vowelR] then
Line 874 ⟶ 894:
end
)
text = string.gsubstring_gsub(text, "("..V..")( *)h([jw]) *$",
function(vowel, _, secondary)
if F2[vowel] ~= F2[secondary] then
Line 884 ⟶ 904:
-- Protect word-final epenthetic vowels after non-glides
-- from next operation.
text = string.gsubstring_gsub(text, "([ptkmnNrl][jGw]"..V..")(@ )", "%1/%2")
-- De-epenthesize vowels if they still neighbor unsurfaced glides.
text = string.gsubstring_gsub(text, "("..V..")@( *h.)", "%1%2")
text = string.gsubstring_gsub(text, "(h. *"..V..")@", "%1")
-- Adjust F1 of currently remaining epenthetic vowels.
Line 900 ⟶ 920:
)
text = string.gsubstring_gsub(text, "/", "")
end
-- Delete all remaining unsurfaced glides.
text = string.gsubstring_gsub(text, "h.", "")
-- Surface realization for {yi'y}.
text = string.gsubstring_gsub(text, "yj", "i^")
if not diphthongs then
Line 935 ⟶ 955:
-- Turn this surfaced glide into an epenthetic vowel.
text = string.gsubstring_gsub(text, "([ptkmnNrl]. *[aEei])%^( *"..V..")", "%1@%2")
end
if MERGED_VOWELS then
text = string_gsub(text, "[EO]", function(vowel)
return VOWEL[F1[vowel] + 1][F2[vowel]]
end)
end
Line 958 ⟶ 984:
index = index2
until index == 1
text = table.concattable_concat(chars, "")
end
Line 968 ⟶ 994:
["l"] = { ["j"] = "L" }
}
for primary in mw.text.gsplitmw_text_gsplit("ptkmnNrl", "") do
local map = CONSON_REFLEX[primary]
if not map then
Line 981 ⟶ 1,007:
-- Tweak remaining consonants, using offsets as a guide.
text = string.gsubstring_gsub(text, "()(.)([jGw])( *)([ptkmnNrl]?)([jGw]?)()",
function(
offsetL, primaryL, secondaryL, _, primaryR, secondaryR, offsetR
Line 1,004 ⟶ 1,030:
end
local geminated = primaryL == primaryR
if primaryL ~= CONSON_REFLEX[primaryL][secondaryL]"t" and primaryR == "t" then
-- /tʲ/ is palatalized postalveolar.
if primaryR ~= "" then
-- /tˠ/ is velarized dental.
-- /nʲ, rʲ, lʲ/ are palatalized dental.
-- /nˠ, rˠ, lˠ/ are velarized postalveolar.
-- Assimilate primary dental or postalveolar.
primaryL = CONSON_REFLEX[primaryL]
[secondaryL == "j" and "G" or "j"]
primaryR = CONSON_REFLEX[primaryR][secondaryR]
else
primaryL = CONSON_REFLEX[primaryL][secondaryL]
if primaryR ~= "" then
primaryR = CONSON_REFLEX[primaryR][secondaryR]
end
end
if primaryR == "T" then
Line 1,041 ⟶ 1,078:
secondaryL = ""
end
else
elseif primaryL ~= "l" then
secondaryL = ""
end
Line 1,066 ⟶ 1,103:
-- Elegantly connect long and epenthetic vowels across word gaps.
text = string.gsubstring_gsub(text, "(["..V_..":]): +", "%1 : ")
text = string.gsubstring_gsub(text, "("..V..") +%1([^%^])", "%1 :%2")
text = string.gsubstring_gsub(text, "("..V..") +%1$", "%1 :")
text = string.gsubstring_gsub(text, "("..V..")@ +%1", " %1 :")
text = string.gsubstring_gsub(text, "("..V.."@) +", " %1 ")
if W_OFF_GLIDES then
-- Add [w] off-glides after certain consonants.
-- Add [(w)] off-glides after certain consonants.
subst = function(primary, secondary, infix, _, vowel, epenth)
subst = function(primary, _, epenth)
if epenth == "" then
if epenth == "" then
return primary..infix.."Hw".._..vowel
return primary.."Hw".._
end
end
if PHONETIC_DETAILS then
text = string_gsub(text, "([pbm])(G *[aEei])(@?)",
function(primary, _, epenth)
if epenth == "" then
return primary.."B".._
end
end
)
else
text = string_gsub(text, "([pbm])G( *[aEei])(@?)", subst)
end
text = string_gsub(text, "([kgN])w( *[aEeiAV7M])(@?)", subst)
end
if SPECIAL_EPENTHESIS then
text = string_gsub(text, "(.)@("..V..")", "%1^%2")
end
text = string.gsub(text, "([pbm])(G)(:?)( *)([aEei])(@?)", subst)
text = string.gsub(text, "([kgN])(w)(:?)( *)([aEeiAV7M])(@?)", subst)
end
if SPECIAL_EPENTHESIS then
text = string_gsub(text, "(.)@", "(%1)")
text = string_gsub(text, "%)(=?)%(", "%1")
end
-- Convert remaining word gaps to liaison.
text = string.gsubstring_gsub(text, "^ *", "")
text = string.gsubstring_gsub(text, " *$", "")
text = string.gsubstring_gsub(text, " +", false and "_" or "")
if not PHONETIC_IPA then
Line 1,092 ⟶ 1,150:
["p"] = "p",
["b"] = "b",
["B"] = "β̞",
["t"] = "t",
["d"] = "d",
Line 1,122 ⟶ 1,181:
["u"] = "u",
["^"] = ASYLL,
["@"] = BREVEASYLL,
["("] = "<small>(</small>",
[")"] = "<small>)</small>",
[":"] = "ː",
["="] = TIE2
}
if PHONETIC_DETAILS then
assign(map, {
["t"] = "t̪",
["T"] = "t̠",
["d"] = "d̪",
["D"] = "d̠",
["s"] = "s̠",
["z"] = "z̠",
["k"] = "k̠",
["g"] = "ɡ̠",
["n"] = "n̠",
["J"] = "n̪",
["N"] = "ŋ̠",
["r"] = "r̠",
["R"] = "r̪",
["l"] = "l̠",
["L"] = "l̪",
["a"] = "æ̝",
["E"] = "ɛ̝",
["E@"] = "e"..map["@"],
["E^"] = "e"..map["^"],
["Q"] = "ɒ̝",
["O"] = "ɔ̝",
["O@"] = "o"..map["@"],
["O^"] = "o"..map["^"]
})
end
map["T"] = map["T"] or map["t"]
map["D"] = map["D"] or map["d"]
map["S"] = map["S"] or (map["T"]..TIE..map["s"])
map["Z"] = map["Z"] or (map["D"]..TIE..map["z"])
map["kG"] = map["kG"] or map["k"]
map["gG"] = map["gG"] or map["g"]
Line 1,138 ⟶ 1,226:
map["Hj"] = map["Hj"] or map["i"]..map["^"]
local key
for primary in mw.text.gsplitmw_text_gsplit("pbtdTDSZszkgmnJNrRlL_pbBtdTDSZszkgmnJNrRlL_", "") do
for secondary in mw.text.gsplitmw_text_gsplit("jGw", "") do
key = primary..secondary
map[key] = map[key] or (map[primary]..map[secondary])
end
end
for vowel in mw.text.gsplitmw_text_gsplit(V_, "") do
key = vowel.."@"
map[key] = map[key] or (map[vowel]..map["@"])
Line 1,152 ⟶ 1,240:
PHONETIC_IPA = map
end
text = string.gsubstring_gsub(text, ".[jGw@%^]?", PHONETIC_IPA)
addUnique(outSeq, text)
Line 1,168 ⟶ 1,256:
-- For other values, list both possible dialect reflexes where applicable.
local dialect = args and args.dialect and
mw.ustring.lowermw_ustring_lower(mw.text.trimmw_text_trim(args.dialect)) or ""
if dialect == "rālik" then
dialect = "ralik"
Line 1,181 ⟶ 1,269:
-- Real-world pronunciation said to vary by sociological factors,
-- but all realizations may occur in free variation.
local modeJ = splitChars(args and args.J and string.lowerstring_lower(args.J) or "tst")
local initialJ = PHONETIC_ARG_J[modeJ[1] or ""] or "t"
local medialJ = PHONETIC_ARG_J[modeJ[2] or ""] or "s"
Line 1,210 ⟶ 1,298:
for _, str in pairs(inSeq) do
str = string.gsubstring_gsub(str, S, " ")
str = string.gsubstring_gsub(str, "^ *", "")
str = string.gsubstring_gsub(str, " *$", "")
local isRalik = dialect == "ralik"
if isRalik or dialect == "ratak" then
Line 1,241 ⟶ 1,329:
 
function export.bender(frame)
return table.concattable_concat(toBender(parse(frame.args[1], frame.args)), ", ")
end
 
Line 1,249 ⟶ 1,337:
 
function export.parse(frame)
return table.concattable_concat(parse(frame.args[1]), ", ")
end
 
function export.phonemic(frame)
return table.concattable_concat(toPhonemic(parse(frame.args[1])), ", ")
end
 
function export.phonetic(frame)
return table.concattable_concat(toPhonetic(parse(frame.args[1]), frame.args), ", ")
end