Content deleted Content added
adding a function to generate Part names for Smyth refs; this is much simpler than using a template since regex has to be used to find the first number |
m fix results for nil or empty string |
||
Line 20:
SmythData = data.Smyth
path = SmythData.path
local Part,
url, Part = "No number provided", "No number provided"
if sectionNumber < 189 then▼
Part = "Part I: Letters, Sounds, Syllables, Accent"▼
elseif sectionNumber < 822 then▼
Part = "Part II: Inflection"▼
elseif sectionNumber < 900 then▼
Part = "Part III: Formation of Words"▼
elseif sectionNumber < 3049 then▼
Part = "Part IV: Syntax"▼
else
sectionNumber = tonumber(section)
error("The largest valid section number is 3048")▼
if sectionNumber == nil then
Part = ""
else
▲ Part = "Part I: Letters, Sounds, Syllables, Accent"
▲ Part = "Part II: Inflection"
▲ Part = "Part III: Formation of Words"
▲ Part = "Part IV: Syntax"
else
▲ error("The largest valid section number is 3048")
end
end
url = url(path, part, section)
end
return { url = url
end
|