Handbook
Glossary
parse-srt-chunk ( seq -- srt-chunk )
Vocabulary
subrip-subtitles
Inputs
seq
an
object
Outputs
srt-chunk
an
object
Definition
USING:
arrays
ascii
kernel
math.parser
sequences
splitting
;
IN:
subrip-subtitles
:
parse-srt-chunk
( seq -- srt-chunk )
[
?first
string>number
]
[
?second
" "
split1
[
"-->"
split1
[
[
blank?
]
trim
parse-srt-timestamp
]
bi@
]
[
[
blank?
]
trim
split-words
sift
[
f
]
[
[
":"
split1
nip
string>number
]
map
first4
swapd
[
2array
]
2dip
2array
2array
]
if-empty
]
bi*
]
[
2
tail
join-lines
]
tri
srt-chunk
boa
;