Skip to content

Commit

Permalink
Open STM files as UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
reuben committed Apr 18, 2017
1 parent c73d5d3 commit f598078
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/stm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import codecs
import unicodedata

class STMSegment(object):
Expand Down Expand Up @@ -55,7 +56,7 @@ def parse_stm_file(stm_file):
Parses an STM file at ``stm_file`` into a list of :class:`STMSegment`.
"""
stm_segments = []
with open(stm_file) as stm_lines:
with codecs.open(stm_file, encoding="utf-8") as stm_lines:
for stm_line in stm_lines:
stmSegment = STMSegment(stm_line)
if not "ignore_time_segment_in_scoring" == stmSegment.transcript:
Expand Down

0 comments on commit f598078

Please sign in to comment.