From 4f2bd962d07c4d8ba69c85c3c32ea1a072daf396 Mon Sep 17 00:00:00 2001 From: jungjun0708 Date: Wed, 19 Nov 2025 20:31:01 +0900 Subject: [PATCH] Fix path_to_file_list to read lines --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 0d1f17b..6b985e5 100644 --- a/main.py +++ b/main.py @@ -2,7 +2,10 @@ def path_to_file_list(path: str) -> List[str]: """Reads a file and returns a list of lines in the file""" - li = open(path, 'w') + lines: List[str] = [] + with open(path, "r", encoding="utf-8") as f: + for line in f: + lines.append(line.rstrip("\n")) return lines def train_file_list_to_json(english_file_list: List[str], german_file_list: List[str]) -> List[str]: