I’m faced with a situation where I’m reading a string of text and I need to detect the language code (en, de, fr, es, etc).
Is there a simple way to do this in python?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need to detect language in response to a user action then you could use google ajax language API:
Output
Google Translate API v2
Default limit 100000 characters/day (no more than 5000 at a time).
Now you could request detecting a language explicitly:
Example:
Output