diff --git a/autokara/__init__.py b/autokara/__init__.py index 90276fd22093df5e55cac1c56b8ea0767c7f451c..32f115eb1c23d031caea04f3f804bf988c979a96 100644 --- a/autokara/__init__.py +++ b/autokara/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.2.0" \ No newline at end of file +__version__ = "0.2.1" \ No newline at end of file diff --git a/autokara/autosyl/LyricsAlignment/utils.py b/autokara/autosyl/LyricsAlignment/utils.py index 09f470313891efd49ec0e441c1acfdebf6d1e330..7c6389ed2f671d78a9db386bfe4adc05bf589fd7 100644 --- a/autokara/autosyl/LyricsAlignment/utils.py +++ b/autokara/autosyl/LyricsAlignment/utils.py @@ -152,21 +152,21 @@ def gen_phone_gt(words, raw_lines, language="jp", uppercase_as_english=True): idx_in_full_p.append([s1, s2]) s1 = s2 + 1 - # beginning of a line - idx_line_p = [] - last_end = 0 - for i in range(len(raw_lines)): - line = [] - line_phone = [(g2p_uppercase(word.lower()) if regex_uppercase.sub('', word) == '' else g2p(word.lower())) for word in raw_lines[i].split()] - for l in line_phone: - line += l + [' '] - line = line[:-1] - line = [phone if phone[-1] not in string.digits else phone[:-1] for phone in line] - offset = getsubidx(lyrics_p[last_end:], line) - assert (offset >= 0) - assert (line == lyrics_p[last_end + offset:last_end + offset + len(line)]) - idx_line_p.append([last_end + offset, last_end + offset + len(line)]) - last_end += offset + len(line) + # beginning of a line + idx_line_p = [] + last_end = 0 + for i in range(len(raw_lines)): + line = [] + line_phone = [(g2p_uppercase(word.lower()) if regex_uppercase.sub('', word) == '' else g2p(word.lower())) for word in raw_lines[i].split()] + for l in line_phone: + line += l + [' '] + line = line[:-1] + line = [phone if phone[-1] not in string.digits else phone[:-1] for phone in line] + offset = getsubidx(lyrics_p[last_end:], line) + assert (offset >= 0) + assert (line == lyrics_p[last_end + offset:last_end + offset + len(line)]) + idx_line_p.append([last_end + offset, last_end + offset + len(line)]) + last_end += offset + len(line) return lyrics_p, words_p, idx_in_full_p, idx_line_p