This commit is contained in:
Auric Vente
2024-07-25 21:43:00 -06:00
parent 6c09901496
commit b853eade5d
2 changed files with 24 additions and 13 deletions

View File

@@ -160,10 +160,19 @@ class Utils:
return random.choice(filtered)
@staticmethod
def random_word() -> str:
word = Utils.rand_word.word(
include_parts_of_speech=["nouns", "adjectives"], word_max_length=8
)
def random_word(noun: bool = True, adj: bool = True) -> str:
opts = []
if noun:
opts.append("noun")
if adj:
opts.append("adjective")
if not len(opts):
return ""
word = Utils.rand_word.word(include_parts_of_speech=opts, word_max_length=8)
return str(word)