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

感叹词等反复翻译成一个超长的句子 #6

Open
echopan opened this issue Aug 2, 2024 · 1 comment
Open

感叹词等反复翻译成一个超长的句子 #6

echopan opened this issue Aug 2, 2024 · 1 comment

Comments

@echopan
Copy link

echopan commented Aug 2, 2024

一句字幕如果不是在陈述一个具体的意思, 而是感叹或者一两个单词的话, 就会反复翻译这个短语, 变成一个超长的句子, 有办法解决吗?
Snipaste_2024-08-03_06-28-52
像是上面截出来的这些这样

@echopan
Copy link
Author

echopan commented Aug 12, 2024

一个有比没有好的方法, 至少不会让字幕占满屏幕:
找一个支持正则语法的编辑器, 使用下面的表达式进行查找替换:

(?<=([,\.!]|[^\S\n]|[\u4E00-\u9FA5])[^\n]{10})[^\n]{30,35}([,\.!]|[^\S\n]|[\u4E00-\u9FA5])[^\n]{5,}

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

1 participant