Created
April 22, 2023 15:44
-
-
Save hmhard/5cf258e5f3eb5bbd7f1d728481749827 to your computer and use it in GitHub Desktop.
text translator script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from textblob import TextBlob | |
text="there are a lot of books in my bag" | |
while text: | |
text=input("enter text") | |
if text is None: | |
break | |
blob= TextBlob(text) | |
print(blob.detect_language()) | |
if blob.detect_language()== 'en': | |
print(blob.translate(to='am')) | |
else: | |
print(blob.translate(to='en')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment