jesselau76 / ebook-GPT-translator

Enjoy reading with your favorite style.
https://jesselau.com
MIT License
1.63k stars 210 forks source link

此处代码是否需要修改? #42

Open stara-lfur opened 1 year ago

stara-lfur commented 1 year ago

text_translation.py 中的第 300 行: def return_text(text): text = text.replace(".", ".\n")

是否应该将text.replace(".", ".\n") 改为text.replace(". ", ".\n")? 因为 . 不一定表示英文中的句号,也有可能出现在数字(如3.14)或者代码中(如text.replace); 在 . 后面加上空格,才能准确地对应英文中的句号。

不知我的想法是否正确,望解答~

jesselau76 commented 1 year ago

感谢指出,应该是要修改。

On Mon, May 22, 2023 at 12:02 AM zcwang99 @.***> wrote:

text_translation.py 中的第 300 行: def return_text(text): text = text.replace(".", ".\n")

是否应该将text.replace(".", ".\n") 改为text.replace(". ", ".\n")? 因为 . 不一定表示英文中的句号,也有可能出现在数字(如3.14)或者代码中(如text.replace); 在 . 后面加上空格,才能准确地对应英文中的句号。

不知我的想法是否正确,望解答~

— Reply to this email directly, view it on GitHub https://github.com/jesselau76/ebook-GPT-translator/issues/42, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUSHGGNDL2NRYCJMQAKAJ3XHH763ANCNFSM6AAAAAAYJLIWFE . You are receiving this because you are subscribed to this thread.Message ID: @.***>