Skip to content

How to Prevent English Contractions From Being Split in SRT Segments? #123

Answered by jianfch
chislon asked this question in Q&A
Discussion options

You must be logged in to vote
result.merge_all_segments().split_by_punctuation([("","'")]).merge_by_punctuation([("", "'")], lock=True)

This should do the trick. If you use ["'"] it only looks for the ones ending with ' and not those starting with '. But your case is that it starts with '.

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@jianfch
Comment options

@chislon
Comment options

@jianfch
Comment options

@jianfch
Comment options

Answer selected by chislon
@chislon
Comment options

@chislon
Comment options

@chislon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants