terryyin / translate-python

Online translation as a Python module & command line tool. No key, no authentication needed.
MIT License
724 stars 155 forks source link

Runtime error #83

Closed arsenikov closed 2 years ago

arsenikov commented 3 years ago

It works perfectly when i use small words But when i use a sentence

Code:

from translate import Translator
translator = Translator(to_lang="ml")
trns= translator.translate("ithane malayalam")

Traceback:

Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/translate/translate.py", line 45, in return ' '.join(self.provider.get_translation(text_wraped) for text_wraped in text_list) File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/translate/providers/mymemory_translated.py", line 49, in get_translation next_best_match = next(match for match in matches) StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 1, in File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/translate/translate.py", line 45, in translate return ' '.join(self.provider.get_translation(text_wraped) for text_wraped in text_list) RuntimeError: generator raised StopIteration

HudsonLeong commented 2 years ago

I met this bug as well.....Could you please share me your solution?