Because you have to start somewhere. Here's a first attempt at Human names/naming conventions.
Task was to name a human male, female, building, street, district, and city. Name elements are given and proper names, prefix & suffixes. 6 naming methods and a dice function.
Using Python 3 with IDLE. This is the pinnacle of where I'm at with Python and, indeed, programming at all. I'm certain no one needs to read this, but:
[code]
#NAMER
#defines a _roll function which returns a random whole number
#defines six naming functions with six different sets of rules and chances
# _name_man
# rolls for random _man_given and _family
# joins as proper name and prints
# 40% chance of _family suffix
# 5% chance of _family prefix
#
# _name_woman
# rolls for random _woman_given and _family
# joins as proper name and prints
# 40% chance of _family suffix
# 5% chance of _family prefix
#
# _name_place
# rolls for random _generic_abstract_name and _place_suffix
# joins as proper name and prints
#
# _name_street
# rolls for random _generic_abstract_name and _street_suffix
# joins as proper name and prints
# 20% chance of _street_prefix instead of _street_suffix
#
# _name_district
# rolls for random _generic_abstract_name, prints name
# 40% chance of _city_suffix as compound name
#
# _name_city
# rolls for random _generic_abstract_name and _city_suffix
# joins as compound name and prints them
#drawing from nine discrete lists
# _generic_personal_name
# _generic_abstract_name
# _city_suffix
# _street_prefix
# _street_suffix
# _place_suffix
# _man_given
# _woman_given
# _family_prefix
# _family_suffix
#then tests the rules, outputting names for:
# a man
# a woman
# a place
# a street
# a district
# a city
import random
#The Lists
_generic_personal_name = ('Adom', 'Aethyr', 'Amber', 'Ames', 'Arch', 'Arden',\
'Arken', 'Auto', 'Ax', 'Barrow', 'Bathys', 'Battles', 'Bel',\
'Bell', 'Bismut', 'Blessed', 'Bonden', 'Bracken', 'Bundt',\
'Burgun', 'Caul', 'Chevalier', 'Clay', 'Copper', 'Crippen', 'Crow',\
'Dahl', 'Dahlko', 'Dead', 'Diav', 'Donov', 'Dun', 'Eccles',\
'Enders', 'Esper', 'Falens', 'Fitz', 'Fleur', 'Fonden', 'Foss',\
'Free', 'Frost', 'Gatz', 'Geist', 'Glast', 'Glaz', 'Glimmer',\
'Glinten', 'Glover', 'Gold', 'Gosz', 'Grail', 'Grey', 'Haartz',\
'Hames', 'Hammers', 'Harrow', 'Harts', 'Hauk', 'Haupt',\
'Hilton', 'Holtz', 'Idle', 'Imps', 'Incarnad', 'Indus', 'Iron',\
'Isen', 'Jakkes', 'Jet', 'Jopf', 'Jovian', 'Kelsey', 'Koch',\
'Kovach', 'Kreutz', 'Kurtz', 'Lead', 'Lime', 'Lumen',\
'Machine', 'Marles', 'Marlin', 'Marls', 'Marrow', 'Martens',\
'Master', 'Mihr', 'Mill', 'Minor', 'Mont', 'Murk', 'Nephil',\
'New', 'Nexus', 'Nils', 'Novodt', 'Novot', 'Old', 'Opel',\
'Ottz', 'Parc', 'Paz', 'Phalen', 'Philo', 'Plexis', 'Porphyris',\
'Powers', 'Quarles', 'Quoyle', 'Rael', 'Rayfen', 'Red',\
'Regis', 'Reign', 'Richten', 'Ridley', 'Rock', 'Rosen',\
'Sand', 'Severin', 'Sharpe', 'Silk', 'Silt', 'Smith',\
'Spar', 'Stone', 'Stuk', 'Suage', 'Swann', 'Taal',\
'Tarver', 'Taxis', 'Tomb', 'Tower', 'Tropp', 'Unter',\
'Urban', 'Vail', 'Voltz', 'Wahr', 'Weston', 'White',\
'Win', 'Wing', 'Wren', 'Young', 'Zapf', 'Zephyrs', 'Zorn')
_generic_abstract_name = ('Absalom', 'Angle', 'Arcade', 'Archon', 'Argosy',\
'Arrow', 'Arsenal', 'Ash', 'Aspic', 'Avian', 'Bailey',\
'Bar', 'Barge', 'Barten', 'Battery', 'Baud', 'Beam', 'Beaming',\
'Bell', 'Bill', 'Billet', 'Block', 'Bosun', 'Book', 'Boon',\
'Borget', 'Boss', 'Brace', 'Bream', 'Brewery', 'Brick', 'Broad',\
'Buckram', 'Budge', 'Bureau', 'Butchers', 'Camac', 'Candle',\
'Capstan', 'Caput', 'Carpenter', 'Cartwright', 'Catholic', 'Chain',\
'Channel', 'Charity', 'Chequer', 'Chestnut', 'Chop', 'Clarion',\
'Clerk', 'Cog', 'Constancy', 'Cordage', 'Croft', 'Crone', 'Cutting',\
'Delancey', 'Delilah', 'Demense', 'Dashiel', 'Diadem', 'Discretion',\
'Dock', 'Dolphin', 'Dorsal', 'Down', 'Dross', 'Durbin', 'East',\
'Edge', 'Eider', 'Eiseminger', 'Elder', 'Eleven', 'Ellsworth',\
'Emory', 'Exeter', 'Fabian', 'Fiat', 'Field', 'Flag', 'Flagstaff',\
'Fog', 'Fortitude', 'Fosse', 'Four', 'Gaffer', 'Gaol', 'Garrison',\
'Gas', 'Gasket', 'Gear', 'Glass', 'Gleaner', 'Glover', 'Gorey',\
'Goss', 'Grail', 'Grand', 'Grape', 'Grave', 'Green', 'Grove',\
'Haft', 'Hansom', 'Hedge', 'Helles', 'Hempen', 'Herald',\
'Hook', 'Hurley', 'Ibid', 'Ivory', 'Icemans', 'Jade', 'Juniper',\
'Kart', 'Kastom', 'Kater', 'Kiln', 'Lading', 'Lake',\
'Lampwright', 'Lantern', 'Lark', 'Lead', 'Lesser', 'Lessing',\
'Lido', 'Lilac', 'Little', 'Livery', 'Lock', 'Locker', 'Locket',\
'Locust', 'Lombard', 'Louche', 'Madrigal', 'Majestic',\
'Marfin', 'Market', 'Match', 'Maturin', 'Mechanics',\
'Mercy', 'Mill', 'Mistral', 'Mitre', 'Moire', 'Monument',\
'Moon', 'Mote', 'Mute', 'Netting', 'Needle', 'Newton',\
'Night', 'North', 'Null', 'Oaken', 'Oar', 'Organ', 'Palaestra',\
'Paper', 'Partition', 'Pasha', 'Passenger', 'Paving', 'Pearl',\
'Peregrine', 'Petal', 'Pica', 'Pick', 'Pike', 'Pilot', 'Pine',\
'Policy', 'Port', 'Porter', 'Power', 'Printers', 'Prudence',\
'Pulley', 'Punch', 'Pylon', 'Racquet', 'Rail', 'Reed',\
'Regatta', 'Republican', 'Ring', 'Rittner', 'River',\
'Rodman', 'Roud', 'Royal', 'Sabre', 'Salton', 'Sansom',\
'Scupper', 'Severance', 'Sextant', 'Shambles',\
'Shepards', 'Sinfonia', 'Sloop', 'Snare', 'South', 'Spar',\
'Sparrow', 'Specimen', 'Spirit', 'Spruce', 'St. Germaine',\
'Stack', 'Stencil', 'Stock', 'Stone', 'Stratus', 'Swanns',\
'Swifts', 'Tailor', 'Tasker', 'Teak', 'Temperance', 'Thorn',\
'Ticket', 'Tinker', 'Toll', 'Tow', 'Tower', 'Trade', 'Traitors',\
'Vellum', 'Vine', 'Walnut', 'Water', 'Waterworks', 'Watts',\
'West', 'Westin', 'Whale', 'Wheel', 'Whistle', 'Wicker',\
'Winding', 'Yard', 'Yendor')
_city_suffix = ('abel', 'back', 'bad', 'bath', 'bay', 'boro', 'bourg', 'burg', 'burgh',\
'by', 'cross', 'derry', 'dock', 'don', 'feld', 'field', 'flag', 'ford', 'gallow', 'gard', 'garten',\
'gate', 'glen', 'grave', 'ham', 'haven', 'head', 'heim', 'helm', 'holm', 'hook', ' Isle',\
'knot', 'low', 'mark', 'math', 'muth', 'misen', 'mond', 'mute',\
'myre', 'neck', 'port', 'ray', 'shire', 'smith', ' Cross', ' Point', 'test', 'ton', 'wold',\
'wood', 'ztock')
_street_prefix = ('Rue', 'Via')
_street_suffix = ('Avenue', 'Lane', 'Road', 'Street', 'Walk', 'Way')
_place_suffix = ('House', 'Home', 'Park', 'Arms', 'Place', 'Building', 'Hotel')
_man_given = ('Abraham', 'Alexander', 'Alexey', 'Angstrom', 'Anton',\
'Auguste', 'Ballard', 'Benjamin', 'Boris', 'Burton', 'Christopher', 'Claude',\
'Cullen', 'Daniel', 'Danilo', 'David', 'Dmitri', 'Dominic', 'Eskander',\
'Ethan', 'Felix', 'Frederick', 'Friedrich', 'Gaspar', 'Gordon', 'Gregor',\
'Gustav', 'Henri-David', 'Henry', 'Horace', 'Ian', 'Jack', 'James',\
'Jasper', 'Jean-Baptiste', 'John', 'Jonathan', 'Joshua', 'Karl',\
'Kenneth', 'Leonidas', 'Liam', 'Louis', 'Maxwell', 'Milton',\
'Montgomery', 'Nathaniel', 'Orson', 'Oskar', 'Peter', 'Philip',\
'Prescott', 'Rene', 'Sebastien', 'Simon', 'Stanislaus', 'Stefan',\
'Stefan', 'Stephen', 'Talmidge', 'Thomas', 'Victor', 'Vincent',\
'Walter', 'William')
_woman_given = ('Agata', 'Alice', 'Amy', 'Anna', 'Anne',\
'Annika', 'Anya', 'Beatrix', 'Blanka', 'Bridget', 'Chloe', 'Cicely',\
'Clara', 'Deborah', 'Diana', 'Donatella', 'Dora', 'Elizabeth', 'Ellen',\
'Emily', 'Francesca', 'Grace', 'Gwendolen', 'Hannah', 'Helen', 'Helene',\
'Isabel', 'Jane', 'Josephine', 'Judith', 'Juno', 'Katherine', 'Katya',\
'Lillian', 'Louisa', 'Lucia', 'Lucy', 'Madchen', 'Margaret', 'Mary',\
'Melinda', 'Mona', 'Parker', 'Pauline', 'Proserpine', 'Rachel',\
'Rebecca', 'Rebekka', 'Rose', 'Sara', 'Simone', 'Sophia', 'Tia',\
'Veronica', 'Victoria', 'Zoe')
_family_prefix = ('von ', 'Van ', 'Mac', 'del ')
_family_suffix = ('artz', 'black', 'bok', 'bracken', 'branch', 'coer', 'comb',\
'dottir', 'down', 'essen', 'etti', 'fen', 'gard', 'gut', 'hauer', 'league',\
'mann', 'mark', 'marr', 'ment', 'met', 'mill', 'ori', 'pool', 'rank', 'sea',\
'shade', 'son', 'song', 'stern', 'table', 'tan', 'veldt', 'vine', 'ward',\
'water', 'wave', 'white', 'wood', 'wright')
# roll function
def roll(sides, dice):
result = 0
for rolls in range(0, dice):
result += random.randint(1, sides)
return result
#six naming functions for six naming tasks
def name_man():
f = random.choice(_man_given)
g = random.choice(_generic_personal_name)
h = roll(100,1)
if h <=40:
i = random.choice(_family_suffix)
g = (g + i)
print(f, g)
elif h >= 95:
j = random.choice(_family_prefix)
g = (j + g)
print(f, g)
else:
print(f, g)
def name_woman():
f = random.choice(_woman_given)
g = random.choice(_generic_personal_name)
h = roll(100,1)
if h <=40:
i = random.choice(_family_suffix)
g = (g + i)
print(f, g)
elif h >= 95:
j = random.choice(_family_prefix)
g = (j + g)
print(f, g)
else:
print(f, g)
def name_place():
f = random.choice(_generic_abstract_name)
g = random.choice(_place_suffix)
print(f, g)
def name_street():
f = random.choice(_generic_abstract_name)
g = random.choice(_street_suffix)
h = roll(100,1)
if h <=20:
i =random.choice(_street_prefix)
print(i, f)
else:
print(f,g)
def name_district():
f = random.choice(_generic_abstract_name)
h = roll(100,1)
if h<= 40:
g = random.choice(_city_suffix)
print('District of', f + g)
else:
print(f, 'District')
def name_city():
f = random.choice(_generic_abstract_name)
g=random.choice(_city_suffix)
print('City of', f + g)
#***test script***
flag = 0
while flag < 10:
name_man()
name_woman()
name_place()
name_street()
name_district()
name_city()
print()
flag = (flag + 1)
/code]
Output is not bad, double consonants don't bother me but triples do. It's all got a pretty decent antiquated & Europe-y feel to it.
The next step would be to make the methods work with seven different "languages". Tags or something. Then add a step to each function that tests for trebly repeated consonants and sheds one. I don't know how much further I should go with Python before starting over with C++. [/code]