otsaloma / gaupol

Editor for text-based subtitle files
https://otsaloma.io/gaupol/
GNU General Public License v3.0
250 stars 35 forks source link

Empty lines remain after correction #187

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello,

Ubuntu Impish (21.10) Gaupol 1.9-1 Aeidon 1.9-1

Tools/Correct Texts/Remove empty lines checked. Zero empty lines removed

otsaloma commented 3 years ago

It only removes subtitles that are blank after corrections, so primarily it's intended for use when removing hearing impaired subtitles, if e.g. everything between [...] is removed and there's nothing else left, then the whole subtitle will be removed as well.

There isn't currently a feature to remove blank subtitles otherwise, it hasn't been a common issue to my knowledge.

ghost commented 3 years ago

OK, thanks for explanation. I had an out of sync subfile which I used as translation in Gaupol. After just opening these subtitles they became synced, at least they look like so. However I got many empty lines as a buy product. Seems I just need to use grep and/or other Linux tools to get rid of them. Or maybe you can point me a way to do it with aeidon lib. Unfortunately I don’t program in Python, but I know how to make a proggie in it.

W dniu niedz., 8.08.2021 o 15:44 Osmo Salomaa @.***> napisał(a):

It only removes subtitles that are blank after corrections, so primarily it's intended for use when removing hearing impaired subtitles, if e.g. everything between [...] is removed and there's nothing else left, then the whole subtitle will be removed as well.

There isn't currently a feature to remove blank subtitles otherwise, it hasn't been a common issue to my knowledge.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/otsaloma/gaupol/issues/187#issuecomment-894799997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUMQIO6T2NE2SUEIJI7Y63T32C3HANCNFSM5BYPTZFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

otsaloma commented 3 years ago

One way to do it would be to first do a search-replace in Gaupol: Search for \A\Z and replace with []. \A\Z is basically a regular expression for a blank string. You need to check the "Regular expression" box in the dialog. Then you can use the correct texts feature to remove hearing impaired stuff between square brackets and resulting empty subtitles will be removed as well. This will work as long as there are no brackets used elsewhere.

And, generally speaking, the reason why I say is that it's not a common issue is that blank subtitles don't usually do any harm. Playback should work fine, you can leave them in the file. But, if they somehow bother when editing or something, try the above.

ghost commented 3 years ago

Thanks again, you're very helpful. I used grep cause it WAS easy. I wanted to know how many of these lines were, so i did: @.***:~$ grep ",,$" $s | wc -l 367 These are ASS subtitles. Now I use only.this format, which I find much more flexible than SRT. I just had to modify /usr/share/gaupol/headers/ass file to my needs

Kind regards Osmo, Marek

niedz., 8 sie 2021 o 16:58 Osmo Salomaa @.***> napisał(a):

One way to do it would be to first do a search-replace in Gaupol: Search for \A\Z and replace with []. \A\Z is basically a regular expression for a blank string. You need to check the "Regular expression" box in the dialog. Then you can use the correct texts feature to remove hearing impaired stuff between square brackets and resulting empty subtitles will be removed as well. This will work as long as there are no brackets used elsewhere.

And, generally speaking, the reason why I say is that it's not a common issue is that blank subtitles don't usually do any harm. Playback should work fine, you can leave them in the file. But, if they somehow bother when editing or something, try the above.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/otsaloma/gaupol/issues/187#issuecomment-894809928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUMQIOAFZW2SYJIJLO3L6LT32LRFANCNFSM5BYPTZFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .