I have written a program that opens a file and translates it word by word, but it has a big problem, and that is that it only gives one type of meaning. I want to make it return the meaning of the word according to the sentence for For example, show the meaning of the word <Season> according to the following sentences. Example:
- My favorite season is winter.
- The recipe says to season the dish with plenty of salt.
I used the following codes also want to display the pronunciation of the word
season /ˈsiː.zən/
from googletrans import Translator
g = Translator()
def tr(ch):
return(g.translate(ch,'fa').text)
I searched many sites but could not find the answer