Module:rad-IPA: Difference between revisions

Jump to navigation Jump to search
m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
mNo edit summary
Line 439: Line 439:


if s_len == 0 then
if s_len == 0 then
error("Empty input.")
error("Empty input")
end
end


Line 459: Line 459:
   
   
  if data[split_s[s_len + i]] == nil then
  if data[split_s[s_len + i]] == nil then
error("'" .. split_s[s_len + i] .. "' is an invalid character.")
error("'" .. split_s[s_len + i] .. "' is an invalid character")
  end
  end
   
   
Line 469: Line 469:
  -- generate_IPA: mw.log("Index acquired: " .. getData)
  -- generate_IPA: mw.log("Index acquired: " .. getData)
else
else
  error(split_s[s_len] .. " is an invalid character.")
  error(split_s[s_len] .. " is an invalid character")
end
end
else
else
Line 1,163: Line 1,163:
mw.log("Word registered to output.")
mw.log("Word registered to output.")
else
else
error("An empty word cannot be registered.")
error("An empty word cannot be registered")
end
end
else
else
error("Empty or invalid input to stress().")
error("Empty or invalid input to stress()")
end
end
end
end
Line 1,175: Line 1,175:
if #working_word == 0 or working_word == nil then
if #working_word == 0 or working_word == nil then
error("The working word is empty.")
error("The working word is empty")
elseif #working_word == 1 then -- monosyllabic?
elseif #working_word == 1 then -- monosyllabic?
Line 1,219: Line 1,219:
else
else
error("Invalid syllable count.")
error("Invalid syllable count")
end
end
elseif syllables[1] == nil then
elseif syllables[1] == nil then
error("Empty syllable found in array. The array should contain no empty syllables.")
error("Empty syllable found in array. The array should contain no empty syllables")
else -- if boundary is identified as the working word, then
else -- if boundary is identified as the working word, then
mw.log ("Boundary syllable identified.")
mw.log ("Boundary syllable identified.")

Navigation menu