diff --git a/process_data/utils.py b/process_data/utils.py index f26b57c..6183db4 100644 --- a/process_data/utils.py +++ b/process_data/utils.py @@ -9,3 +9,10 @@ def read_file(filename): with open(filename, "r", encoding="utf-8") as fin: 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) +