local RULE_NAMES = {
	categories = {
		monster_city = {
			preprefix = {
				"The",
				"Good",
				"Evil",
				"Last",
				"For",
				"My",
			},
			prefix = {
				"Dark",
				"Lucid",
				"Vicious",
				"Scary",
				"Insane",
				"Mental",
				"Thorny",
				"Hollow",
				"Shady",
				"Cold",
				"Gangrene",
				"Smog",
				"Ivy",
				"Undergroth",
				"Rancid",
			},
			mid = {
				"Spear",
				"Hulk",
				"Bog",
				"Hill",
				"Town",
				"Village",
				"Tower",
				"Keep",
				"Farm",
				"Trader",
				"Square",
				"Top",
				"Mountain",
				"Crop",
				"Tavern",
				"Obelisk",
				"Spike",
			},
			suffix = {
				"work",
				"inn",
				"jo",
				"ie",
				"er",
				"ark",
			},
		},
		village = {
			preprefix = {
				"The",
				"A",
				"Our",
				"Lords",
			},
			prefix = {
				"Little",
				"Humble",
				"Thirsty",
				"Cosy",
				"Quaint",
				"Boar",
				"Bear",
				"Bull",
			},
			mid = {
				"Inn",
				"Village",
				"Well",
				"Quench",
				"Bed",
				"Shelter",
				"Tavern",
				"Guest"	
			},
			suffix = {
				"place",
				"come",
				"house",
				"side",
			},
		},
		undead = {
			preprefix = {
				"The",
				"A",				
			},
			prefix = {
				"Ghastly",
				"Heavenly",
				"Undead",
				"Rising",
				"Walker",
				"Tomb",
				"Risen",
				"Condemned",
			},
			mid = {
				"Graveyard",
				"Cemetary",
				"Necropolis",
				"Boneyard",
				"Memorial",
				"Burial Ground",
			},
			suffix = {
				"place",
				"come",
				"house",
				"side",
			},
		},
		merchant = {
			prefix = {
				"Fair",
				"Adventurous",
				"Bartering",
				"Worldly",
				"Excellent",
			},
			mid = {
				"Cart",
				"Goods",
				"Trinkets",
				"Goods",
				"Merchant",			
			},
		},
		forest = {
			preprefix = {
				"The",
				"A",
				"Nature's",
			},
			prefix = {
				"Little",
				"Vast",
				"Old",
				"Flowing",
				"Sprouting",
				"Infested",
				"Moldy",
				"Lush",
			},
			mid = {
				"Lily",
				"Heaven",
				"Hell",
				"Bark",
				"Worm",
				"Grass",
				"Rock",
				"Hill",
				"Valley"	
			},
			suffix = {
				"wood",
				"hall",
				"echo",
				"bush",
				"timbre",
				"log",
			},
		},
		camp = {
			preprefix = {
				"The",
				"A",
			},
			prefix = {
				"Evil",
				"Insane",
				"Maniacal",
				"Delirious",
				"Lunatical",
				"Mad",
				"Raving",
				"Demoniac",
			},
			mid = {
				"Camp",
				"Cantonment",
				"Ritual",
				"Hut",
				"Quarters",
				"Outpost",
				"Garrison",
				"Billet",				
			},
			suffix = {
				"fall",
				"hell",
				"craze",
				"dance",
			},
		},
	},
	generate = function(rules, def, level)
		local name = ""
		
		if def.preprefix then
			if math.random() < 0.2 then
				name = string.optional_concat(name,def.preprefix[math.random(1,#def.preprefix)], " ")
			end
		end

		if math.random() < 0.75 then
			name = string.optional_concat(name,def.prefix[math.random(1,#def.prefix)], " ")
		end

		if math.random() < 0.75 or name == "" then
			name = string.optional_concat(name,def.mid[math.random(1,#def.mid)], " ")
		end

		if def.suffix then
			if math.random() < 0.2 then
				name = string.optional_concat(name,def.suffix[math.random(1,#def.suffix)], "")
			end
		end

		def.gen = def.gen or {}
		local num = (def.gen[name] or 0) + 1
		def.gen[name] = num

		if num > 1 then
			name = name .." ".. string.rep("I", num)
		end
		return name
	end,
}

return RULE_NAMES