我正在尝试开发英文脚本中与算法相关的印地文单词,并且输出应为英文单词。
我尝试输入:Badaam输出:杏仁,但我想要输入:badam输出:杏仁
import request
from indic_transliteration import sanscript
from indic_transliteration.sanscript import transliterate
from googletrans import Translator
translator = Translator()
convert = 'badaam'
word_obtained=transliterate(convert, sanscript.ITRANS,
sanscript.DEVANAGARI)
print(word_obtained)
translated = translator.translate(word_obtained, src='hi', dest='en')
print(translated.text)