Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/better alias generator #74

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 141 additions & 67 deletions modules/alias.py
Original file line number Diff line number Diff line change
@@ -1,76 +1,150 @@
_prefixes = [
'Aged', 'Ancient', 'Bubbly', 'Bitter', 'Black', 'Blue', 'Bold', 'Brave',
'Broad', 'Broken', 'Calm', 'Cold','Colossal', 'Cool', 'Crimson', 'Curly', 'Damp',
'Dark', 'Daring', 'Delicate', 'Falling', 'Fancy', 'Super', 'Jiggly',
'Flat', 'Fragrant', 'Frosty', 'Gentle', 'Green', 'Legendary',
'Icy', 'Jolly', 'Jumping', 'Little', 'Lively', 'Lucky', 'Lonely',
'Muddy', 'Mute', 'Noisy', 'Odd', 'Old', 'Orange', 'Polished', 'Proud',
'Purple', 'Quiet', 'Rapid', 'Red', 'Restless', 'Rough', 'Round', 'Royal', 'Shiny',
'Shy', 'Silent', 'Small', 'Snowy', 'Soft', 'Solitary', 'Sparkling', 'Spring',
'Square', 'Super', 'Sweet', 'Tight', 'Tiny', 'White', 'Wild', 'Yellow', 'Young', 'Sticky',
'Fluffy', 'Petite', 'Grumpy', 'Happy', 'Sleepy', 'Gray', 'Average', 'Hungry', 'Honorable',
'Kind', 'Lazy', 'Lethal', 'Macho', 'Massive', 'Puzzled', 'Rare', 'Spooky', 'Sassy', 'Tricky',
'Unique', 'Naive', 'Drowzy', 'Hot', 'Innocent', 'Naughty', 'Mischievous', 'Smart', 'Fun',
'Crazy', 'Shrewd', 'Basic', 'Gutsy', 'Cute', 'Drunk', 'Sober', 'Depressed', 'Slimy', 'Gross',
'Needy', 'Dark', 'Light', 'Roaring', 'Soaring', 'Noble', 'Vain', 'Terrifying', 'Scary',
'Studious', 'Huge', 'Enormous', 'Big', 'Giant', 'Great', 'Playful', 'Classy', 'Cold',
'Early', 'Deep', 'Awesome', 'Enhanced'
]

_nouns_male = [
'King', 'Prince', 'Bandit', 'Hulk', 'Thor', 'Leo', 'Deadpool', 'Trump',
'Moustache', 'Arrow', 'Caspian', 'Horse', 'Frog', 'Monkey', 'Lion',
'Tiger', 'Cheetah', 'Eagle', 'Wizard', 'Hawk', 'Jack', 'Hippo' , 'Stallion' , 'Bull' , 'Buck',
'Emperor','Ram', 'Captain', 'Batman', 'Robin', 'Deathstroke', 'Cyborg', 'Wolverine', 'Spiderman',
'Flash', 'Panther', 'Daredevil', 'Ironman', 'Joker', 'Aquaman', 'Necromancer', 'Warlock', 'Magneto',
'Gambit', 'Cyclops', 'Ronin', 'Warden', 'Duke', 'Lord', 'Darth', 'Vader', 'Goku', 'Gohan', 'Broly',
'Ash', 'Antman', 'Doom', 'General', 'Snake', 'Devil', 'Sergeant', 'Detective', 'Demon', 'Birdman',
'Jarvis', 'Ultron', 'Stark', 'Lannister', 'Baratheon', 'Tully', 'Greyjoy', 'Tarth', 'Phasma',
'Sailor', 'Mufasa', 'Simba', 'Ninja', 'Swordsman', 'Don', 'Gangster', 'Superman', 'Doomsday',
'Lucifer', 'Serpent', 'Count', 'Anakin', 'Luke', 'Sherlock', 'Watson', 'House', 'Nemo'
]

_nouns_female = [
'Alexa','Lili', 'Princess', 'Rihanna', 'Swift', 'Queen', 'LaserGirl', 'Mermaid',
'Butterfly', 'Batgirl', 'Madonna', 'Foxie', 'Lioness', 'Monroe', 'Eve', 'Xiry',
'Snail', 'Unicorn', 'Moon', 'Dove', 'Witch', 'Rose', 'Zebra', 'Seahorse', 'Squirrel' , 'Doe', 'Empress',
'Vixen', 'Widow', 'Supergirl', 'Storm', 'Catwoman', 'WonderWoman', 'Hawkgirl', 'Amazon', 'Mystique', 'Raven',
'Banshee', 'Enchantress', 'Ivy', 'Minx', 'Nova', 'Duchess', 'Bachelorette', 'Cat', 'Flower', 'Daisy',
'Sunflower', 'Lady', 'Mist', 'Misty', 'Superwoman', 'Gal', 'Dynamo', 'Connoisseur', 'Huntress',
'Angel', 'Goddess', 'Mystery', 'Maiden', 'Dame', 'Damsel', 'Beauty', 'Artist', 'Chick', 'Snake',
'Heroine', 'Tomboy', 'Doll', 'Spinster', 'Bride', 'Countess', 'Babe', 'Dora', 'Mistress', 'Highness',
'Ariana', 'Emma', 'Harley'
]
import random

_SIZE_DESCRIPTORS = [
'huge', 'small', 'enormous', 'big',
'giant', 'tiny', 'massive', 'little'
]
_ADJECTIVE_DESCRIPTORS = [
'lonely', 'calm', 'awesome', 'enhanced', 'depressed', 'drunk',
'sober', 'great', 'noble', 'studious', 'cold', 'playful',
'fun', 'crazy', 'shrewd', 'basic', 'gutsy', 'cute',
'innocent', 'naughty', 'mischievous', 'smart',
'tricky', 'unique', 'naive', 'drowzy', 'hot', 'sassy',
'massive', 'puzzled', 'rare', 'spooky', 'lethal',
'macho', 'lazy', 'kind', 'honourable', 'hungry', 'happy',
'average', 'sleepy', 'grumpy', 'silent', 'shy',
'needy', 'classy', 'scary', 'vain', 'early', 'soft'
'deep', 'sweet', 'wild', 'light', 'dark', 'super',
'brave', 'broad', 'broken', 'colossal', 'square',
'muddy', 'mute', 'noisy', 'odd', 'old', 'young',
'gentle', 'cool', 'broken', 'bold', 'bitter',
'bubbly', 'broad', 'curly', 'ancient', 'aged',
'damp', 'petite', 'snowy', 'soft', 'shiny',
'slimy', 'sticky', 'gross', 'early', 'spring',
'solitary', 'needy', 'deep', 'royal', 'round', 'rough',
'restless', 'rapid', 'quiet', 'proud', 'polished',
'lucky', 'jolly', 'lively', 'icy', 'legendary',
'frosty', 'fragrant', 'flat', 'jiggly', 'fancy',
'delicate', 'misty'
]

_COLOR = [
'gray', 'yellow', 'orange', 'white', 'black',
'blue', 'green', 'crimson', 'red', 'purple',
'cyan', 'azure', 'cerulean', 'teal', 'pink',
'aqua'
]
_ACTION_DESCRIPTORS = [
'terrifying', 'roaring', 'soaring',
'sparkling', 'daring', 'falling',
'jumping'
]

_NAMES_MALE = [
'Leo', 'Thor', 'Caspian', 'Ash',
'Luke', 'Don', 'Mufasa', 'Duke',
'Goku', 'Lucifer', 'Simba', 'Anakin',
'Jack', 'Joe', 'Solomon', 'Nero',
'Nemo', 'King', 'Emperor', 'Robin',
'Ram', 'Prince', 'Ronin', 'Count',
'Lord', 'Jarvis'
]

_NAMES_FEMALE = [
'Lili', 'Lilith', 'Rihanna', 'Alexa', 'Cortana'
'Mermaid', 'Madona', 'Lioness',
'Eve', 'Rose', 'Princess', 'Queen',
'huntress', 'vixen', 'Ivy', 'Minx',
'Nova', 'Daisy', 'Lady', 'raven',
'gal', 'goddess', 'emma', 'dora',
'ariana', 'mistress', 'highness',
'babe', 'tomboy', 'bride', 'doll',
'empress'
]

_NAMES_UNISEX = [
'Eagle', 'Bull', 'Fox', 'Vixen',
'Stallion', 'Cheetah', 'Lion',
'Tiger', 'Monkey', 'Frog', 'Horse',
'Hippo', 'Hawk', 'Wizard', 'Witch',
'Bull', 'Buck', 'Captain', 'Arrow',
'Trump', 'Cyborg', 'Wolverine',
'Spider', 'Bat', 'Bandit', 'Panther',
'Cat', 'Joker', 'Necromancer', 'Devil',
'Demon', 'Warlock', 'Mage', 'Warden',
'Ant', 'Vader', 'Stark', 'Lannister',
'Baratheon', 'Greyjoy', 'Sailor',
'General', 'Captain', 'Corporal',
'Cyclops', 'Tully',
'Phasma', 'Bird', 'Birb', 'ninja',
'Sargeant', 'Detective', 'snake',
'serpent', 'sherlock', 'watson',
'house', 'gambit', 'sailor',
'baratheon', 'doom', 'doomsday',
'warden', 'warrior', 'waffles',
'candy', 'Swift', 'Butterfly',
'Monroe', 'moon', 'dove', 'dawn',
'sunflower', 'mist', 'snail',
'zebra', 'unicorn', 'seahorse',
'squirrel', 'storm', 'banshee',
'flower', 'angel', 'beauty', 'artist'
]

_suffixes = [
'OfAdua', 'OfAtlantis', 'OfCimmeria', 'OfDarkWood', 'OfDune',
'OfEgypt', 'OfLalaland', 'OfMidgard', 'OfNowhere', 'OfOz', 'OfSparta',
'OfTheDesert', 'OfTheForest', 'OfTheFuture', 'OfTheIsland',
'OfTheJungle', 'OfTheLand', 'OfTheSea','OfTheWorld', 'TheAgeless',
'TheBabyface', 'TheBarbarian', 'TheBetrayer', 'TheBrave',
'TheDestroyer', 'TheGhost', 'TheGreat', 'TheHammer', 'TheLionheart',
'TheOld', 'TheQuiet', 'TheSecond', 'TheShadow', 'TheTall',
'TheTemplar', 'TheTraveler', 'TheWanderer', 'TheWeakest', 'TheWise',
'UnderThePass', 'ofTheBay', 'ofTheDay', 'ofTheNight'
'OfAdua', 'OfAtlantis', 'OfCimmeria', 'OfDarkWood', 'OfDune',
'OfEgypt', 'OfLalaland', 'OfMidgard', 'OfNowhere', 'OfOz',
'OfSparta', 'OfTheDesert', 'OfTheForest', 'OfTheFuture',
'OfTheIsland', 'OfTheJungle', 'OfTheLand', 'OfTheSea',
'OfTheWorld', 'TheAgeless', 'TheBabyface', 'TheBarbarian',
'TheBetrayer', 'TheBrave', 'TheDestroyer', 'TheGhost',
'TheGreat', 'TheHammer', 'TheLionheart', 'TheOld', 'TheQuiet',
'TheSecond', 'TheShadow', 'TheTall', 'TheTemplar',
'TheTraveler', 'TheWanderer', 'TheWeakest', 'TheWise',
'UnderThePass', 'ofTheBay', 'ofTheDay', 'ofTheNight'
]

import random
_NAMES = {
'male': _NAMES_MALE,
'female': _NAMES_FEMALE
}
DESCRIPTORS = _ADJECTIVE_DESCRIPTORS + _SIZE_DESCRIPTORS


def generate_alias(gender):
noun = ""
prefix = ""
suffix = ""
if gender == "male":
noun = random.choice(_nouns_male)
else:
noun = random.choice(_nouns_female)
if _toss_a_coin():
prefix = random.choice(_prefixes)
def random_noun(gender):
return random.choice(_NAMES_UNISEX + _NAMES[gender])


def random_descriptor(noun):
return random.choice(DESCRIPTORS) if (noun not in _NAMES_UNISEX) else random.choice(DESCRIPTORS + _ACTION_DESCRIPTORS)


def random_color():
return random.choice(_COLOR)


def random_suffix():
return random.choice(_suffixes)


format = lambda *array: "".join(map(lambda word: word[0].upper() + word[1:], array))


def generate_alias(gender, size=30):
noun = random_noun(gender)
descriptor = random_descriptor(noun)
color = random_color()
suffix = random_suffix()
if len(color + descriptor + noun + suffix) <= size:
return format(color, descriptor, noun, suffix)
elif len(descriptor + noun + suffix) <= size:
return format(descriptor, noun, suffix)
elif len(noun + suffix) <= size:
return format(noun, suffix)
elif len(descriptor + noun) <= size:
return format(descriptor, noun)
else:
suffix = random.choice(_suffixes)
return '{0}{1}{2}'.format(prefix, noun, suffix)
return format(noun)[:size]


def _toss_a_coin():
return random.randint(0, 1) == 0
for i in range(100):
print(generate_alias(random.choice(['male', 'female']), random.randrange(10, 30)))
Binary file modified static/endchat1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/gifs/giphy-downsized.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/gifs/giphy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/startchat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.