Skip to content

Commit

Permalink
fix readFile in mecab_system_eval.py for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
taishi-i committed Jun 11, 2020
1 parent d793068 commit 9a1a115
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nagisa/mecab_system_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from __future__ import division, print_function, absolute_import

import sys
import codecs

if sys.version_info.major == 3:
PY_3 = True
else:
Expand All @@ -12,7 +14,7 @@
def readFile(filename):
sent = []
data = []
with open(filename, "r") as f:
with codecs.open(filename, 'r', encoding='utf_8_sig') as f:
for line in f:
line = line.rstrip()
if line == "EOS":
Expand Down

0 comments on commit 9a1a115

Please sign in to comment.