Jump to content

Module:CountryAdjectiveDemonym and Module:CountryAdjectiveDemonym/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
simplified code
 
No edit summary
 
Line 69: Line 69:
CountryAdjectiveDemonymDoLoadData()
CountryAdjectiveDemonymDoLoadData()
end
end

local similarLongerNouns = mw.loadData( 'Module:CountryAdjectiveDemonym/LongerNouns' )
for adjective, noun in pairs(countryAdjectivesToNounsTable) do
for adjective, noun in pairs(countryAdjectivesToNounsTable) do
if string.find(s, adjective) or string.find(s, noun) then
if string.find(s, adjective) or string.find(s, noun) then
for longerNoun, nameToUse in pairs(similarLongerNouns) do
if string.find(s, longerNoun) then
return nameToUse
end
end
return noun
return noun
end
end