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

Error Occurred, No result found #28

Closed Ragingthunder567 closed 3 years ago

Ragingthunder567 commented 5 years ago

Description Error while using the module with random - word failing to generate a word

To Reproduce from random_word import RandomWords import time

r = RandomWords()

def word_array(primo): word_arr = [] for x in range (len(primo)): word_arr.append(primo[x])

return word_arr

def gap(): print("") print("")

print("Welcome to Hangman!") time.sleep(0.5) print("Ready to play?") gap() time.sleep(1) word = r.get_random_word(minLength = 4, maxLength = 8, hasDictionaryDef = "true") print(word)

Expected behavior Expected to get a word.

Environment (please complete the following information):

jasperan commented 5 years ago

Having the same issue. Is it possible that we are making too many HTTP requests and there is an unknown rate limiting that we don't know of?

plaffitte commented 5 years ago

Same issue here:

Exception: Error occured, No result found. If you think this was a mistake than raise issue at https://github.com/vaibhavsingh97/random-word/issues

mmichealjroberts commented 5 years ago

I am receiving the same issue:

 File "x/x/x/env/lib/python3.7/site-packages/random_word/random_word.py", line 60, in get_random_word
   "Error occured, No result found. If you think this was a mistake than raise issue at {}".format(self.issue_url))
Exception: Error occured, No result found. If you think this was a mistake than raise issue at https://github.com/vaibhavsingh97/random-word/issues

Using the following:

random_word = r.get_random_word(hasDictionaryDef="true", includePartOfSpeech="noun,verb", minCorpusCount=1, maxCorpusCount=10, minDictionaryCount=1, maxDictionaryCount=10, minLength=5, maxLength=10)
jared-bloomer commented 4 years ago

Same Issue for me as well. Using a quick isolated script to test it out

The Script:

#!/usr/bin/env python3

def word():
    from random_word import RandomWords
    r = RandomWords()
    word = r.get_random_word(hasDictionaryDef="true")
    return word

def main():
    print(word())

if __name__ == "__main__":
    main()

The Result:

Traceback (most recent call last):
  File "./randomword", line 13, in <module>
    main()
  File "./randomword", line 10, in main
    print(word())
  File "./randomword", line 6, in word
    word = r.get_random_word(hasDictionaryDef="true")
  File "/usr/local/lib/python3.7/site-packages/random_word/random_word.py", line 60, in get_random_word
    "Error occured, No result found. If you think this was a mistake than raise issue at {}".format(self.issue_url))
Exception: Error occured, No result found. If you think this was a mistake than raise issue at https://github.com/vaibhavsingh97/random-word/issues
BBFC-Gaming commented 4 years ago

Same thing is happening to me. I tried to put time.sleep(2) in between the lines, but it didn't fix it.

EdwardTheLegend commented 4 years ago

I get the same thing too. My current solution is close it down and come back later.

alliefitter commented 4 years ago

~I just got this error, though it doesn't seem to be persistent. I've resorted to using this function.~

def make_random_word(self):
    words = RandomWords()
    word = None
    while not word:
        try:
            word = words.get_random_word()
        except:
            pass

    return word

EDIT: Yeah, didn't test this before posting. It's still just doesn't work. Right now my script is just hanging as it loops over indefinitely

juan-solorio-program commented 4 years ago

Same issue here.

Exception: Error occured, No result found. If you think this was a mistake than raise issue at https://github.com/vaibhavsingh97/random-word/issues

vaibhavsingh97 commented 3 years ago

I had released a new version on PyPI (https://pypi.org/project/Random-Word/1.0.6/), this will fix recent issues.