Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf翻译时有回车符的问题 #4

Open
wuhongjun15 opened this issue Mar 22, 2019 · 3 comments
Open

pdf翻译时有回车符的问题 #4

wuhongjun15 opened this issue Mar 22, 2019 · 3 comments

Comments

@wuhongjun15
Copy link

平时在阅读英文paper的时候,会复制到谷歌翻译进行处理,但是经常会发现复制的文字中间有一些多余的回车符导致翻译效果很差,所以您这里文字提取是否可以“吃掉”回车符,还是说在翻译的时候会进行处理?

@AnuoF
Copy link
Owner

AnuoF commented Mar 22, 2019

平时在阅读英文paper的时候,会复制到谷歌翻译进行处理,但是经常会发现复制的文字中间有一些多余的回车符导致翻译效果很差,所以您这里文字提取是否可以“吃掉”回车符,还是说在翻译的时候会进行处理?

你好,可以去掉的,你可以在代码中修改如下代码(T_Pdf_pdfminer.py --> translate()方法中):

if content: to_trans_content = content.replace("\r\n","") ret = translate_func(to_trans_content)

@TaylorLei
Copy link

我自己写了一小段,基本能实现了。
感谢博主。

@TaylorLei
Copy link

感谢博主。

另外表示 有道翻译源 好像实现的效果不太好, 能不能直接调用电脑里有道翻译软件的翻译模块?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants