How full translate a word with python?

44 Views Asked by At

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:

  1. My favorite season is winter.
  2. 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

0

There are 0 best solutions below