From 4088ed4c88d34c3e449e90479d965645e586bb3d Mon Sep 17 00:00:00 2001 From: breadcat Date: Wed, 30 Sep 2020 08:59:47 +0100 Subject: Slight script update --- content/posts/formatting-dumped-subtitles.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'content/posts') diff --git a/content/posts/formatting-dumped-subtitles.md b/content/posts/formatting-dumped-subtitles.md index 1d00c4a..9a48b5e 100644 --- a/content/posts/formatting-dumped-subtitles.md +++ b/content/posts/formatting-dumped-subtitles.md @@ -8,11 +8,12 @@ tags : [ "Formats", "Languages", "Linux", "Media", "Snippets", "Software", ] As per my previous post, you should now have a single `srt` subtitle file, to convert this into a single word list that you can begin translating away at, you can run the below verbose script. ``` -tr ' ' '\n' < subs.srt \ - sed -e 's/<[^>]*>//g' \ - tr '[:upper:]' '[:lower:]' \ - tr -d '\>\/!-.:?,.\",[:digit:]' \ - sed -e '/^[[:space:]]*$/d' -re 's/\s+$//' -re 's/\{...\}//' \ +tr ' ' '\n' < subs.srt | \ + sed -e 's/<[^>]*>//g' | \ + tr '[:upper:]' '[:lower:]' | \ + tr -d '\>\/!-.:?,.\",[:digit:]' | \ + tr -d '…' | \ + sed -e '/^[[:space:]]*$/d' -re 's/\s+$//' -re 's/\{...\}//' | \ sort -u > subs-sort.srt ``` @@ -22,4 +23,5 @@ One issue I've noticed is some _special_ characters won't be converted to lowerc
tr 'ÆØÅÄÖÐÞÁÉÍÓÚÝ' 'æøåäöðþáéíóúý'
+* **Edit 2020-09-23:** Added elipses removal, fixed pipes * **Edit 2020-07-05:** Added {\an} tag removal -- cgit v1.2.3