python调用谷歌翻译

from GoogleFreeTrans import Translator

if __name__ == '__main__':
    translator = Translator.translator(src='en', dest='zh-CN')
print(translator.translate('I love you'))
from googletrans import Translator

translator = Translator(service_urls=['translate.google.cn'])

title = 'Today is a gooday'

title_alternative = translator.translate(title, dest='zh-CN').text

print (title_alternative)

前者会以句号断句,只翻译第一句,后者会整段翻译。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SDL Trados软件SDK开发包 The SDL Trados 2007 Desktop SDK, Version March 2007 Introduction Sample code uses Visual Basic 6 or C#. The API reference notes co-classes rather than interfaces. Libraries Tag Settings Manager API Location: TradosSettingsManager.dll, which can be found in the SDL Trados Translation Tools installation folder. TRADOS Filter Manager API Location: The relevant DLL can be found in the SDL Trados Translation Tools installation folder on the client side. TagEditor API Location: TagEditor.exe, which can be found in the SDL Trados Translation Tools installation folder. TagEditor Message Collection API Location: TradosMessageCollection.dll, which can be found in the SDL Trados Translation Tools installation folder. TRADOS S-Tagger (Framemaker) API Location: TradosSTaggerFAPI.dll, which can be found in the FI/FM sub-folder of the SDL Trados Translation Tools installation folder. TRADOS S-Tagger (Interleaf) API Location: TradosSTaggerIAPI.dll, which can be found in the FI/IL sub-folder of the SDL Trados Translation Tools installation folder. TRADOS Translator's Workbench (TW4Win) API Location: Tw4win.exe, which can be found in the SDL Trados Translation Tools installation folder. TRADOStag API API Location: TRADOStagApi.dll, which can be found in the SDL Trados Translation Tools installation folder. TRADOS XConvert API Location: TradosXConvert.dll, which can be found in the SDL Trados Translation Tools installation folder. SDK Support Please note that the SDK is provided as is and for use at your own risk. SDL does not provide support and consulting services unless expressly agreed upon in a support & maintenance contract. Copyright © 2007 SDL International. All rights reserved.
Python爬虫谷歌翻译是一个功能强大的工具,可以实现对Excel文件和PDF文件中的内容进行翻译。该爬虫支持对Excel文件进行直接翻译,也可以将PDF文件中的表格转化为Excel再进行翻译。支持的Excel文件格式包括xlsx和xlsm等。\[1\] 使用该爬虫的方法及注意事项如下:首先,将需要翻译的PDF文件放入translate_pdf_to_text_to_word.exe相同的路径下。然后双击translate_pdf_to_text_to_word.exe开始运行。在命令窗口中会提示是否开始将PDF文件转化为txt文件,如果没有txt文件的话,需要按下1生成txt文件。生成的txt文件中的每句话可能会被分成几段,需要手动打开txt文件对段落格式进行调整。按下1后,会提示是否开始翻译,按下y后就开始进行爬虫翻译(使用谷歌翻译),按下3后结束程序。\[2\] 该爬虫对大众语言的翻译效果较好,但对一些偏门的语言可能存在问题。爬虫使用字符串截取的方式解析谷歌的返回数据,因此对于某些语言或矩阵可能会存在截取的问题,但只需修改translate方法中的参数n即可解决。\[3\] #### 引用[.reference_title] - *1* *2* [Python实现谷歌翻译爬虫,翻译PDF,翻译Excel,支持excel文档打开翻译,支持xlsx,xlsm等格式。](https://blog.csdn.net/weixin_48223757/article/details/126157914)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [使用Python爬虫调用谷歌翻译【21年8月】](https://blog.csdn.net/qq_40846669/article/details/119926079)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值