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
AttributeError: 'list' object has no attribute 'strip' #371
Comments
This is happened to me also. This should be fixed ASAP |
This is happened to me also. This should be fixed ASAP, please. I have this problem in production.
I have tried "30 per a line" and I can't get around this error. Only if I use another library, which I don't want to, because I trust TextBlob too much. Can you help, please? |
In the mean time I took the relevant functions and did some modifications to make it work. You guys can just copy this code and it will work (just fix some minor issues that created while copy pasting my code): from textblob.exceptions import NotTranslated headers = { translate_url = "http://translate.google.com/translate_a/t?client=webapp&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&otf=2&ssel=0&tsel=0&kc=1" english_sentence = translate(source="some text in other language") def translate(source, from_lang='auto', to_lang='en', host=None, type_=None): def request(url, host=None, type=None, data=None):
def calculate_tk(source):
def _validate_translation(source, result): |
@igalma your suggested code would be much more readable if you fence it in a markdown code block, this eliminates the reformatting issues. |
what is None and 'it', are they the part of translation or what? |
Over a year later and this is still an issue. Can we get an update? |
Thanks for the working code. I could translate .png files as of now. It fails to support .jpg and other formats. |
from textblob import TextBlob
words = str("Кардиганы из норка")
blob = TextBlob(words)
perevod = blob.translate(from_lang ="ru", to='uk')
print(perevod)
New error I catch today.
It said that: AttributeError: 'list' object has no attribute 'strip'
The text was updated successfully, but these errors were encountered: