0

我正在尝试将部分用日语和部分用英语翻译成英语的文本。我的问题是应用翻译功能后,原文中的一些文本似乎丢失了。

从代码和输出可以看出,

目前仅获得该产品约 20% 至 30% HAZMAT 的 SDS

输出中似乎缺少。

代码

translator.translate(   
'At present only SDS of about 20 to 30% of HAZMAT of the product is obtained.  
Chemicals management (Japan) Qn 4.03 Business operators are responsible for ensuring that necessary information is readily recognized at each workplace dealing with substances specified as requiring safety data sheets (SDS) under the Occupational Safety and Health Act , Or make it known to workers handling such substances. 入手済みのSDSはPandashで確認することが出来る。MTEが使用する化学物質についてはSDSが入手されている。PCコメント(2017/07/10)SDSを入手する基準ですが、すべての商品に対して入手する、というのが原則ではあります。ただし、現在販売されているすべての商品に対して一度にSDSを入手することも難しいため、再判定になったときはSDSの提出をお願いし、ご提出いただいております。なお、もしも何らかの事情でSDSをご提出いただけない場合は、MSDS Exemption',  
src='ja', dest='en').text

输出

'Chemicals management (Japan) Qn 4.03 Business operators are responsible for ensuring that each information is readily recognized at each workplace dealing with substances specified as requiring safety data sheets ( SDS) under the Occupational Safety and Health Act, Or make it known hand to such workers. The obtained SDS can be confirmed with Pandash. For chemical substances used by MTE, SDS has been obtained. PC comment (2017/07/10) It is the standard to obtain SDS, but in principle it is to obtain for all items. However, it is difficult to acquire SDS at the same time for all the products currently on sale, so if you decide to reevaluate it, we ask you to submit SDS and submit it. In addition, if you are unable to submit SDS for any reason, MSDS Exemption'
4

1 回答 1

3

\n这似乎是格式问题,可能是因为您的文本中有换行符 ( )。要解决这个问题,请用三引号 ( """) 将文本括起来,这样可以进行多行输入。

以下似乎给出了您想要的输出:

代码:

from googletrans import Translator

translator = Translator()

translator.translate(
"""At present only SDS of about 20 to 30% of HAZMAT of the product is obtained.
Chemicals management (Japan) Qn 4.03 Business operators are responsible for ensuring that necessary information is readily recognized at each workplace dealing with substances specified as requiring safety data sheets (SDS) under the Occupational Safety and Health Act , Or make it known to workers handling such substances. 入手済みのSDSはPandashで確認することが出来る。MTEが使用する化学物質についてはSDSが入手されている。PCコメント(2017/07/10)SDSを入手する基準ですが、すべての商品に対して入手する、というのが原則ではあります。ただし、現在販売されているすべての商品に対して一度にSDSを入手することも難しいため、再判定になったときはSDSの提出をお願いし、ご提出いただいております。なお、もしも何らかの事情でSDSをご提出いただけない場合は、MSDS Exemption""",
src='ja', dest='en').text

输出:

目前仅获得该产品约 20% 至 30% HAZMAT 的 SDS。化学品管理(日本) Qn 4.03 企业经营者各自负责根据职业安全和健康法要求的每个安全数据表 (SDS),或让处理此类的工人知道。获得的 SDS 可以通过 Pandash 确认。对于 MTE 使用的化学物质,已获得 SDS。PC评论(2017/07/10) SDS是获取标准,但原则上是所有项目都获取。但是,目前在售的所有产品很难同时获取 SDS,因此如果您决定重新评估它,我们要求您提交 SDS 并提交。此外,如果您因任何原因无法提交 SDS,则 MSDS 豁免

于 2019-01-15T11:47:23.143 回答