clean input and resources files
This commit is contained in:
@@ -124,7 +124,11 @@ def write_input_file(process_file: ProcessFile, text: str):
|
||||
with process_file.absolute_input_file.open(
|
||||
"w", encoding="utf8", newline="\n"
|
||||
) as file:
|
||||
file.write(text)
|
||||
for line in text.split("\n"):
|
||||
line = line.strip()
|
||||
if line:
|
||||
file.write(f"{line}\n")
|
||||
|
||||
|
||||
|
||||
def write_resource_file(process_file: ProcessFile, language_id: str, text: str):
|
||||
@@ -132,7 +136,10 @@ def write_resource_file(process_file: ProcessFile, language_id: str, text: str):
|
||||
with process_file.dictionary_resource_file.open(
|
||||
"w", encoding="utf8", newline="\n"
|
||||
) as file:
|
||||
file.write(text)
|
||||
for line in text.split("\n"):
|
||||
line = line.strip()
|
||||
if line:
|
||||
file.write(f"{line}\n")
|
||||
|
||||
|
||||
def pre_process_a_dictionary_file(process_file: ProcessFile, language_id: str):
|
||||
|
||||
Reference in New Issue
Block a user