update the procedure of processing data

This commit is contained in:
zyr 2021-06-07 18:42:22 +08:00
parent 1aa21f4cc6
commit 1d1acb29b3

View File

@ -9,3 +9,10 @@ def read_file(filename):
with open(filename, "r", encoding="utf-8") as fin: with open(filename, "r", encoding="utf-8") as fin:
return fin.readlines() return fin.readlines()
def write_file(sents, filename):
print("Writing data to {}...".format(filename))
with open(filename, "w", encoding="utf-8") as fout:
for sent in sents:
fout.write(sent)