Skip to content

Commit

Permalink
Merge pull request #98 from SebastinSanty/non-ascii
Browse files Browse the repository at this point in the history
Account for non-ASCII characters
  • Loading branch information
neubig committed Mar 26, 2019
2 parents c0ade6d + 610b9d2 commit a7f96e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compare_mt/corpus_utils.py
@@ -1,11 +1,11 @@

def iterate_tokens(filename):
with open(filename, "r") as f:
with open(filename, "r", encoding="utf-8") as f:
for line in f:
yield line.strip().split()

def iterate_nums(filename):
with open(filename, "r") as f:
with open(filename, "r", encoding="utf-8") as f:
for line in f:
yield [float(i) for i in line.strip().split()]

Expand Down

0 comments on commit a7f96e1

Please sign in to comment.