Module:rad-IPA: Difference between revisions

m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
mNo edit summary
Line 105: Line 105:
IPA = {}
IPA = {}


function append_IPA (working_IPA)
function export.append_IPA(working_IPA)
local IPA_size = #IPA --This variable needs to be set before the function or it breaks.
local IPA_size = #IPA --This variable needs to be set before the function or it breaks.
print("————— REGISTERING PHONE —————")
print("————— REGISTERING PHONE —————")
Line 120: Line 120:
-- BEGIN BASE GENERATION --
-- BEGIN BASE GENERATION --


function generate_IPA(s)
function export.generate_IPA(s)
local s_len = utf8.len(s)
local s_len = utf8.len(s)
IPA = {}
IPA = {}
Line 212: Line 212:
  if type(getData) == "string" and (i == 0 or multiMatch == true) then
  if type(getData) == "string" and (i == 0 or multiMatch == true) then
  print("Target acquired of length " .. 1 - i .. ", converting to [" .. getData .. "].")
  print("Target acquired of length " .. 1 - i .. ", converting to [" .. getData .. "].")
  append_IPA(getData)
  export.append_IPA(getData)
  s = string.sub(s, 1, s_len + i - 1)
  s = string.sub(s, 1, s_len + i - 1)
  s_len = string.len(s)
  s_len = string.len(s)
Line 230: Line 230:
function export.generate(frame)
function export.generate(frame)
local args = frame:getParent().args
local args = frame:getParent().args
return generate_IPA(args[1])
return export.generate_IPA(args[1])
end
end


return export
return export