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

maxLength < 5 fails to generate a word. #82

Open askarkg12 opened 2 years ago

askarkg12 commented 2 years ago

When trying to generate small words with length 4 or less, generator fails to do so. The program retries 3 times, but throws an exception after that. I understand that it is because Wordnik responds with code 0, is there anything that can be done to give wordnik extra time to find the word?

To Reproduce

import random_word
r = random_word.RandomWords()
print(r.get_random_word(maxLength=4)

Expected behavior return a word with specified number of characters

Environment (please complete the following information):