Skip to content

Commit

Permalink
Add encoding=utf-8 to a couple more relevant places
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed May 20, 2021
1 parent bcb8e67 commit b40379e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stanza/utils/conll.py
Expand Up @@ -105,7 +105,7 @@ def conll2dict(input_file=None, input_str=None, ignore_gapping=True):
if input_str:
infile = io.StringIO(input_str)
else:
infile = open(input_file)
infile = open(input_file, encoding='utf-8')
doc_conll, doc_comments = CoNLL.load_conll(infile, ignore_gapping)
doc_dict = CoNLL.convert_conll(doc_conll)
return doc_dict, doc_comments
Expand Down Expand Up @@ -207,5 +207,5 @@ def doc2conll_text(doc):
def write_doc2conll(doc, filename):
""" Writes the doc as a conll file to the given filename
"""
with open(filename, 'w') as outfile:
with open(filename, 'w', encoding='utf-8') as outfile:
outfile.write(CoNLL.doc2conll_text(doc))

0 comments on commit b40379e

Please sign in to comment.