Skip to content

Commit

Permalink
Bug fix for #459
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcauliffe committed Jun 4, 2022
1 parent 3944163 commit ffe01f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions montreal_forced_aligner/textgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ def export_textgrid(
if include_utterance_text:
for u in data["utterances"]:
tg.tierDict[utterance_tier_name].entryList.append(u.to_tg_interval())
for tier in tg.tierDict.values():
if tier.entryList[-1][1] > tg.maxTimestamp:
tier.entryList[-1] = Interval(
tier.entryList[-1].start, tg.maxTimestamp, tier.entryList[-1].label
)
if has_data:
for tier in tg.tierDict.values():
if len(tier.entryList) > 0 and tier.entryList[-1][1] > tg.maxTimestamp:
tier.entryList[-1] = Interval(
tier.entryList[-1].start, tg.maxTimestamp, tier.entryList[-1].label
)
tg.save(output_path, includeBlankSpaces=True, format=output_format, reportingMode="error")

0 comments on commit ffe01f3

Please sign in to comment.