I'm working in a python translator, so first of all I need to know the language and what does it have to translate, the translator will recognise phrases that are like How do you say spaguetti in french (for example). For gettig the language (last word) and the content (from fourth to last) and sent it to my function that need (the text, the language) i've done this:
tts.talk(translator(' '.join(phrase.split()[3:-2]), phrase.split()[-1]))
tts.talk is just a tts service that speech the translation. When I try this I get this error:
TypeError: 'module' object is not callable
I've tried to store ' '.join(phrase.split()[3:-2]
and phrase.split()[-1]
as variables and then include them, but id doesn't work anyway.
What should I do?