vaibhavsingh97 / random-word

This is a simple python package to generate random english words
https://pypi.org/project/random-word/
MIT License
123 stars 25 forks source link

problem with defining word type in random_word(). #42

Open KickTrio opened 3 years ago

KickTrio commented 3 years ago

When I add keywords to narrow down the word params it gives an error saying that there is an unexpected keyword. TypeError: random_word() got an unexpected keyword argument 'minLength' To Reproduce from random_words import RandomWords rw = RandomWords()

word = rw.random_word(minLength=2)

print(word)

Expected behavior To get a word with always more then 2 characters.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

RapidCompiler commented 3 years ago

@KickTrio There seem to be a couple of errors in your code. First, you are importing random_words and not random_word. Also, the function to generate a random word is get_random_word() and not just random_word(). I wasn't able to get the exact problem you may have got, but please do let me know if this solves your problem.