Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.get_random_words() sometimes returns an empty list #67

Open
madappally opened this issue May 30, 2021 · 4 comments
Open

r.get_random_words() sometimes returns an empty list #67

madappally opened this issue May 30, 2021 · 4 comments

Comments

@madappally
Copy link

madappally commented May 30, 2021

Describe the bug
r.get_random_words() sometimes returns an empty list.
Is that a problem with API used to generate words?

To Reproduce

def generate_randome():
    r = RandomWords()
    the_list = r.get_random_words(limit=10)
@illyanyc
Copy link

illyanyc commented Jun 7, 2021

I have the same issue, looks like r.get_random_words() sometimes returns an empty list

@arixank
Copy link

arixank commented Jun 14, 2021

yes it does, return an empty word even on r.get_random_word()..!

@madappally
Copy link
Author

I think it's a problem with the API used to generate words. Do they've any limits or something?

@madappally madappally changed the title TypeError: 'NoneType' object is not iterable r.get_random_words() sometimes returns an empty list Jun 14, 2021
@illyanyc
Copy link

illyanyc commented Jun 16, 2021

passing the following params into RandomWords solved the problem, works fine in production.

I think including hasDictionaryDef and includePartOfSpeech is necessary.

r = RandomWords() mnemonic_list = r.get_random_words(hasDictionaryDef="true", includePartOfSpeech="noun,verb", minLength=4, maxLength=6, sortBy="alpha", sortOrder="asc", imit=24)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants