本帖最后由 5i365 于 2022-4-27 17:38 编辑
回复 4# went
大侠好, 现在是从文件中获取文本, 又遇到点小问题:
1.网易翻译, 会在句号的地方分行
2.原回车换行符的地方会留下两个分号
- $s = (gc abc.txt -enc UTF8 -raw) -split '\r\n' -join ';'
- (Invoke-RestMethod "http://fanyi.youdao.com/translate?&doctype=json&type='AUTO'&i=$s").translateResult[0] | foreach {
- $_.src -replace '; $', ''
- $_.tgt -replace '; $', ''
- }
复制代码 -------------------------------------------------------------------------------------------------------------------------
原文下载链接: https://send.cm/d/AT9T
用上面代码翻译的结果如下:
中新网4月27日电 国台办发言人马晓光27日在评价刘畊宏带动两岸民众健身热潮时表示,开展交流是基于血脉相连的亲情,也符合两岸同胞共同利益,越来越多的台湾同胞通过两岸交流合作,获得实实在在的好处。
Beijing, April 27 (Reuters) in evaluating liu geng hong xiao-guang ma, spokesman for the Taiwan affairs office of 27 drive on both sides of the public fitness craze, exchanges are based on the connected by affection, also conforms to the common interests of compatriots on both sides, more and more Taiwan compatriots through the cross-strait exchanges and cooperation, get real benefits.
;
;
27日,国台办举行例行新闻发布会。
27, the Taiwan held a regular press conference.
有记者提问:在沪生活的台湾艺人刘畊宏近来通过新媒体带动两岸民众健身热潮,请问发言人如何看待这一现象?
Have a reporter's question: Taiwan artiste liu geng hong living in Shanghai recently by the new media drive on both sides of the public fitness craze, how could view this phenomenon?
绿媒借机疯狂抹黑打压台湾艺人,对此如何看待?
Green medium to crazy discredit on Taiwan artists, how?
;
;
对此,马晓光表示,在当前疫情防控形势下,互联网、新媒体为两岸同胞相互了解、开展交流,提供了方便路径和新的平台。
The xiao-guang ma said that in the current epidemic situation, the Internet, new media exchanges and mutual understanding of the compatriots on both sides, provides a convenient path and the new platform.
你提到的这个现象就是最好的说明。
You mentioned that this phenomenon is the best explanation.
开展交流是基于血脉相连的亲情,也符合两岸同胞共同利益,越来越多的台湾同胞通过两岸交流合作,获得实实在在的好处。
Exchanges are based on the connected by affection, also conforms to the common interests of compatriots on both sides, more and more Taiwan compatriots through the cross-strait exchanges and cooperation, get real benefits.
大家可能也都注意到,凡是两岸同胞齐声喝采的,必然是**当局“骂”的、“**”势力“黑”的、绿媒“酸”的,这一点也不奇怪。
You may have noticed, all the compatriots on both sides of chorus cheers, is necessarily the democratic progressive party (DPP) authorities "scold", "Taiwan independence" forces "black", green medium "acid", this is not surprising.
相反,这只能说明两岸同胞走亲走近是民心所向、大势所趋,是任何人都阻挡不了的。
On the contrary, this only shows that the compatriots on both sides went close approach is a popular feeling, the trend of The Times, is anyone could not prevent.
原文本段落如下图所示,是三段, 但是翻译后每个句号又分行了, 怎样把按句号分的行接上? 即:一段中文接着一段翻译,而不是按句号分行断开
期待最后结果如下:
|