Mods
This commit is contained in:
parent
c97c6d0a70
commit
d692d8f440
|
@ -235,7 +235,14 @@ class Ants:
|
||||||
words = remove(words, ["of", "de", "da", "the"])
|
words = remove(words, ["of", "de", "da", "the"])
|
||||||
|
|
||||||
if len(words) < 2:
|
if len(words) < 2:
|
||||||
words.extend(Utils.random_word(2 - len(words)))
|
n = random.randint(1, 2)
|
||||||
|
|
||||||
|
if n == 1:
|
||||||
|
words = Utils.random_words(2 - len(words))
|
||||||
|
else:
|
||||||
|
words = Utils.make_words(2 - len(words))
|
||||||
|
|
||||||
|
words.extend(words)
|
||||||
|
|
||||||
return [Utils.capitalize(word) for word in words]
|
return [Utils.capitalize(word) for word in words]
|
||||||
|
|
||||||
|
|
|
@ -160,17 +160,16 @@ class Utils:
|
||||||
return random.choice(filtered)
|
return random.choice(filtered)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def random_word(num: int = 1) -> list[str]:
|
def random_word() -> str:
|
||||||
words = []
|
|
||||||
|
|
||||||
for _ in range(num):
|
|
||||||
word = Utils.rand_word.word(
|
word = Utils.rand_word.word(
|
||||||
include_parts_of_speech=["nouns", "adjectives"], word_max_length=8
|
include_parts_of_speech=["nouns", "adjectives"], word_max_length=8
|
||||||
)
|
)
|
||||||
|
|
||||||
words.append(word)
|
return str(word)
|
||||||
|
|
||||||
return words
|
@staticmethod
|
||||||
|
def random_words(num: int = 1) -> list[str]:
|
||||||
|
return [Utils.random_word() for _ in range(num)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def capitalize(word: str) -> str:
|
def capitalize(word: str) -> str:
|
||||||
|
@ -202,8 +201,11 @@ class Utils:
|
||||||
return name
|
return name
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def make_name() -> str:
|
def make_words(num: int = 1) -> list[str]:
|
||||||
word_1 = Utils.make_word()
|
return [Utils.make_word() for _ in range(num)]
|
||||||
word_2 = Utils.make_word()
|
|
||||||
|
|
||||||
return f"{Utils.capitalize(word_1)} {Utils.capitalize(word_2)}"
|
@staticmethod
|
||||||
|
def make_name() -> str:
|
||||||
|
words = Utils.make_words(2)
|
||||||
|
words = [word.capitalize() for word in words]
|
||||||
|
return " ".join(words)
|
||||||
|
|
Loading…
Reference in New Issue