Module:Sandbox/isaacl/ExpandPageAbbreviation
Appearance
-- For unit tests, see [[Module:Sandbox/isaacl/ExpandPageAbbreviation/tests]]
local moduleSelf = {
-- mw.loadData() not supported, so do not need to access this module for now
-- mw = require("Module:Mw")
}
-- mw.loadData() not supported, so use require() in the meantime
-- moduleSelf.phraseForAbbr = moduleSelf.mw.loadData('Module:Sandbox/isaacl/ExpandPageAbbreviation/data')
moduleSelf.phraseForAbbr =require('Module:Sandbox/isaacl/ExpandPageAbbreviation/data')
function moduleSelf._expand(abbr)
if moduleSelf.phraseForAbbr[abbr] == nil then
return abbr
else
return moduleSelf.phraseForAbbr[abbr]
end
end
function moduleSelf.expand(frame)
local abbr = frame.args[1]
return moduleSelf._expand(abbr)
end
return moduleSelf