Jump to content

Module:Jcon/data/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Map lowercase with proper case
No edit summary
Line 1: Line 1:
local p = {}
local p = {}
local ON = require('Module:Road data/strings/CAN/ON')


-- MTO signs - Table mapping sign names to their image
-- MTO signs - Table mapping sign names to their image
p._signs = {
p.signs = {
['hospital'] = 'Ontario M401.svg',
['hospital'] = 'Ontario M401.svg',
['airport'] = 'Ontario M502.svg',
['airport'] = 'Ontario M502.svg',
Line 13: Line 14:


-- Place types to strip when processing road types
-- Place types to strip when processing road types
p._placeTypes = {
p.placeTypes = {
'municipality',
'municipality',
'municipal',
'municipal',
Line 29: Line 30:


-- Road types from Module:Road_data/strings/CAN/ON
-- Road types from Module:Road_data/strings/CAN/ON
p.typeMap = {}
local ON = require('Module:Road data/strings/CAN/ON')


for type, _ in pairs(ON) do
for type, _ in pairs(ON) do
p[string.lower(type)] = type
p.typeMap[string.lower(type)] = type
end
end



Revision as of 17:39, 24 August 2024

local p = {}
local ON = require('Module:Road data/strings/CAN/ON')

-- MTO signs - Table mapping sign names to their image
p.signs = {                                                             
	['hospital'] = 'Ontario M401.svg',
	['airport'] = 'Ontario M502.svg',
	['bus'] = 'Ontario M506.svg',
	['ferry'] = 'Ontario M508.svg',
	['train'] = 'Ontario M509.svg',
	['train station'] = 'Ontario M509.svg',
	['tch'] = 'TCH-blank.svg'
}

-- Place types to strip when processing road types 
p.placeTypes = {
	'municipality',
	'municipal',
	'city',
	'township',
	'district',
	'county',
	'counties',
	'united counties',
	'region',
	'regional',
	'regional municipality',
	'road'
}

-- Road types from Module:Road_data/strings/CAN/ON
p.typeMap = {}

for type, _ in pairs(ON) do
	p.typeMap[string.lower(type)] = type
end

return p