anupam
(Anupam Pramanik)
1
from googletrans import Translator
txt=‘Hola! Mi nombre es Chris Mattmann’
translator = Translator()
lang=translator.detect(txt)
print(lang)
Output
Detected(lang=en, confidence=1)
I can’t understand why the output is lang=en. My text is polish. Required output is lang=‘pl’
Are you sure the required language is Polish? It looks like Spanish to
me.
“Hola! Mi nombre es Chris Mattmann” is Spanish for "Hello! My name is
Chris Mattman".
Google translate detects it as Spanish.
https://translate.google.com/
So does Cambridge dictionary (powered by Microsoft):
PROMPT-Online also detects it as Spanish:
https://translation2.paralink.com/
DeepL wrongly detects it as German (perhaps fooled by the “mann”
suffix?) and then fails to translate it.
anupam
(Anupam Pramanik)
3
if it is Spanish why the output is en
Blackward
(Dominik Niedenzu)
4
Howdy Anupam,
are you sure, it was not “es” for espanol?
Cheers, Dominik