diff --git a/autosyl/assUtils.py b/autosyl/assUtils.py index cefbfa17909b1e14a7b5424a384ba942be9b9c90..57dc0448c465f76ac10128d14d3dc3cdfa518088 100644 --- a/autosyl/assUtils.py +++ b/autosyl/assUtils.py @@ -33,9 +33,13 @@ def getSyls(ass_file): for line in LINES_KARA.findall(CONTENT): syl_line = [] lastTime = dateToTime(line[0]) + syl_line_index = 0 for couple in RGX_TAGS.findall(line[7]): - if(couple[1] != '' and not couple[1].isspace()): + if couple[1] != '' and not couple[1].isspace(): syl_line.append([lastTime, couple[1], int(couple[0])]) + syl_line_index += 1 + if couple[1].isspace() and len(couple[1]) > 0 and syl_line_index > 0: + syl_line[syl_line_index - 1][1] += " " lastTime += int(couple[0]) syl_line.append([lastTime, '', 0]) SYLS.append(syl_line)