// unused for now
// const prefixes = [
//     "New",
//     "St.",
//     "Little"
// ]

const roots = {
    singles: [ //17
        "Diplo",
        "Cap",
        "Old",
        "Bing",
        "High",
        "Donning",
        "Pro",
        "Fayre",
        "Wofford",
        "Chill",
        "Happ",
        "New",
        "Giles",
        "Nembring",
        "Badgers",
        "Free",
        "Bag",
        "Forest",
        "Mound",
        "Hollywood",
        "Eden",
        "Apple",
        "Sleepy",
        "Golden",
        "Spring",
        "Deer",
        "Jackson",
        "Dodge"
    ],
    compounds: [ //29
        "Diplo",
        "Left",
        "Right",
        "Cow",
        "Cap",
        "Greed",
        "Old",
        "Bing",
        "Grun",
        "High",
        "Up",
        "Nomb",
        "Donning",
        "Pro",
        "Fayre",
        "Wofford",
        "Min",
        "Con",
        "Chill",
        "Happ",
        "New",
        "Gile",
        "Wing",
        "Brough",
        "Nembring",
        "Badger",
        "Free",
        "Reck",
        "Bag",
        "Inver",
        "Oak",
        "Burns",
        "Day",
        "Bay",
        "Will",
        "Ren",
        "Zum",
        "Med",
        "Spring",
        "Deer",
        "Bex"
    ]
}

const suffixes = [ //18
    "borough",
    "ham",
    "stone",
    "pool",
    "field",
    "brook",
    "ton",
    "ing",
    "by",
    "castle",
    "worth",
    "chester",
    "on",
    "stowe",
    "ard",
    "bury",
    "ington",
    "lake",
    "port",
    "burg",
    "ford",
    "dale",
    "wood",
    "ville",
    "boro",
    "ley"
]

// goes at the end.  idk what to call this 🙃
const titles = [ //26
    "Mount",
    "Parkway",
    "Town",
    "North",
    "East",
    "South",
    "West",
    "Vale",
    "Way",
    "Road",
    "Junction",
    "Wood",
    "Low",
    "High",
    "Park",
    "City",
    "Moor",
    "Cross",
    "Crossing",
    "End",
    "Holt",
    "Green",
    "Down",
    "Mere",
    "Heights",
    "Grove",
    "Center",
    "Valley",
    "Prairie",
    "River",
    "Oaks",
    "Hollow"
]

export function generateTitle() {
    const type = Math.random() <= 0.333 ? "singles" : "compounds"
    const root = roots[type][Math.floor(Math.random() * roots[type].length)]
    let suffix = type === "compounds" ? suffixes[Math.floor(Math.random() * suffixes.length)] : ""
    let title = type === "singles" || Math.random() <= 0.7 ? titles[Math.floor(Math.random() * titles.length)] : ""
    return root + suffix + (title === "" ? "" : " " + title)
}