This commit is contained in:
MatOgr 2022-04-26 01:50:31 +02:00
parent ff2f2b124f
commit 89e8437381

3
run.py
View File

@ -7,7 +7,6 @@ import lzma
def read_file(f_name, f_ext=""): def read_file(f_name, f_ext=""):
if f_ext == "xz": if f_ext == "xz":
# data = []
with lzma.open(f"{f_name}.{f_ext}") as file: with lzma.open(f"{f_name}.{f_ext}") as file:
return [line.strip().decode("utf-8") for line in file.readlines()] return [line.strip().decode("utf-8") for line in file.readlines()]
with open(f_name, encoding="utf-8") as file: with open(f_name, encoding="utf-8") as file:
@ -15,7 +14,7 @@ def read_file(f_name, f_ext=""):
def write_file(dir_name, preds): def write_file(dir_name, preds):
with open(f"{dir_name}\out.tsv", "a", encoding="utf-8") as file_out: with open(f"{dir_name}/out.tsv", "a", encoding="utf-8") as file_out:
for val in preds: for val in preds:
file_out.writelines(f"{str(val)}") file_out.writelines(f"{str(val)}")