12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import random
- consonants = ['b', 'v', 'g', 'd', 'zh', 'z', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'f', 'kh', 'ts', 'ch', 'sh', 'sch']
- vowels = ['a', 'e', 'i', 'o', 'u', 'y']
- endings = ['ov', 'ev', 'in', 'yn', 'ski', 'sky', 'ova', 'eva', 'ina', 'yna', 'skaya', 'skya']
- def generate_nickname():
- """Generates a random nickname that sounds vaguely Russian."""
-
- # Start with a consonant or vowel
- if random.random() < 0.7: # Higher chance to start with a consonant
- nickname = random.choice(consonants)
- else:
- nickname = random.choice(vowels)
- # Add 1-2 more syllables
- for _ in range(random.randint(1, 2)):
- nickname += random.choice(vowels)
- nickname += random.choice(consonants)
- # Optionally add an ending
- if random.random() < 0.5:
- nickname += random.choice(endings)
- return nickname.capitalize()
- # import random
- # # List of common Russian consonant sounds (including some consonant clusters)
- # consonants = [
- # 'b', 'v', 'g', 'd', 'z', 'k', 'l', 'm', 'n',
- # 'p', 'r', 's', 't', 'f', 'kh', 'ts', 'ch',
- # 'sh', 'zh', 'bl', 'br', 'pl', 'pr', 'sk', 'sl',
- # 'sm', 'sn', 'sp', 'st', 'str', 'tr', 'dr', 'kr',
- # 'gr', 'gl', 'kl', 'zl', 'shch', 'sch'
- # ]
- # # List of Russian vowel sounds
- # vowels = [
- # 'a', 'e', 'i', 'o', 'u', 'y', 'ya', 'ye',
- # 'yo', 'yu', 'ia', 'ie', 'io', 'iu', 'ei'
- # ]
- # # Possible ending consonant sounds (including empty string for open syllables)
- # end_consonants = [
- # '', 'b', 'v', 'g', 'd', 'z', 'k', 'l', 'm', 'n',
- # 'p', 'r', 's', 't', 'f', 'kh', 'ts', 'ch',
- # 'sh', 'zh', 'st', 'sk', 'nk', 'ng', 'zd', 'nd'
- # ]
- # def generate_syllable():
- # """Generate a syllable with optional onset and coda."""
- # syllable = ''
- # # Decide whether to have an onset (70% chance)
- # if random.random() < 0.7:
- # onset = random.choice(consonants)
- # syllable += onset
- # # Choose a vowel
- # vowel = random.choice(vowels)
- # syllable += vowel
- # # Decide whether to have a coda (50% chance)
- # if random.random() < 0.5:
- # coda = random.choice(end_consonants)
- # syllable += coda
- # return syllable
- # def generate_word(min_syllables=2, max_syllables=2):
- # """Generate a Russian-like word consisting of a random number of syllables."""
- # syllable_count = random.randint(min_syllables, max_syllables)
- # word = ''
- # for _ in range(syllable_count):
- # syllable = generate_syllable()
- # word += syllable
- # return word
- # def generate_russian_like_words(number_of_words):
- # """Generate a list of Russian-like words."""
- # words = []
- # for _ in range(number_of_words):
- # word = generate_word()
- # words.append(word)
- # return words
- # # Example usage:
- # if __name__ == "__main__":
- # number_of_words_to_generate = 10
- # russian_like_words = generate_russian_like_words(number_of_words_to_generate)
- # for word in russian_like_words:
- # print(word)
|