我写了一段代码,功能是合并srt文件中上句结束时间和下句开始时间相同的行,目前的状态是:
1合并后的句子没有问题,合并后每一句的结束时间没有问题。
2合并后每一句的开始时间不对。
我实在太菜鸟了,每一句的开始时间就是不对,
恳请大神帮忙,谢谢
我写了一段代码,功能是合并srt文件中上句结束时间和下句开始时间相同的行,目前的状态是:
1合并后的句子没有问题,合并后每一句的结束时间没有问题。
2合并后每一句的开始时间不对。
我实在太菜鸟了,每一句的开始时间就是不对,
恳请大神帮忙,谢谢
我这边是有缩进格式的,复制过来就变成现在的样子了
你发的代码莫法看
发布信息的时候,在网页端使用代码块发布:
还是没懂怎样发才保持原貌,点了块级代码,复制过来还是不对
大神如果肯帮忙,改好后也可集成在你的小窝工具里面。
读取srt文件,把srt文件中 开始时间和下一个字幕块结束时间合并为一行:
非常感谢大神,我再研究一下。使用场景:自动生成的英语字幕,如果不合并,翻译成汉语后就错误百出。
喜欢的话 赞助一下哇 开发不易。
可以赞助的,前天赞助了30,还会赞助,首先感谢你的帮助,我是不懂写代码的,都是找的教程,照抄,我复制你的第二次发的代码,运行,运行的的结果还是有很多时间相接的行没有合并:
合并前:
1
00:00:00,708 --> 00:00:03,333
the ultimate goal is not only to find
2
00:00:03,333 --> 00:00:05,166
three different species of worms here
3
00:00:05,166 --> 00:00:06,291
on the banks of Maine
4
00:00:06,291 --> 00:00:09,000
but also to test out the bite between the bloodworm
5
00:00:09,000 --> 00:00:15,125
the clamworm and the famed sandworm that is a living
6
00:00:15,125 --> 00:00:17,916
oh nightmare look at that thing
7
00:00:20,875 --> 00:00:21,666
get to Diggin
8
00:00:21,666 --> 00:00:22,958
on this bizarre adventure
9
00:00:22,958 --> 00:00:26,458
I will be working alongside the legendary Pat Spain
10
00:00:26,958 --> 00:00:28,875
this man is wildlife biologist
11
00:00:29,000 --> 00:00:30,208
cryptozoologist
合并后:
1
00:00:00,708 --> 00:00:15,12
the ultimate goal is not only to findthree different species of worms hereon the banks of Mainebut also to test out the bite between the bloodwormthe clamworm and the famed sandworm that is a living
2
00:00:03,333 --> 00:00:05,166
three different species of worms here
3
00:00:05,166 --> 00:00:06,291
on the banks of Maine
4
00:00:06,291 --> 00:00:09,000
but also to test out the bite between the bloodworm
5
00:00:09,000 --> 00:00:15,12
the clamworm and the famed sandworm that is a living
6
00:00:15,125 --> 00:00:17,916
oh nightmare look at that thing
7
00:00:20,875 --> 00:00:26,458
get to Digginon this bizarre adventureI will be working alongside the legendary Pat Spain
8
00:00:21,666 --> 00:00:22,958
on this bizarre adventure
9
00:00:22,958 --> 00:00:26,458
I will be working alongside the legendary Pat Spain
10
00:00:26,958 --> 00:00:28,875
this man is wildlife biologist
11
00:00:29,000 --> 00:00:30,208
cryptozoologist
第二次把函数换为普通方法的,变量放错了。
- 1
- 2
前往