Skip to content
Snippets Groups Projects

Resolve "Read not only .txt files"

1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
+ 3
3
@@ -54,8 +54,8 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
@@ -54,8 +54,8 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
with open(document_path, "r", encoding="utf-8") as _df:
with open(document_path, "r", encoding="utf-8") as _df:
document["text"] = _df.read()
document["text"] = _df.read()
with open(file_path, "a", encoding="utf-8") as _f:
with open(file_path, "a", encoding="utf-8") as _f:
_f.write(f"{json.dumps(document)}\n")
_f.write(json.dumps(document) + "\n")
def process(
def process(
self,
self,
@@ -108,4 +108,4 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
@@ -108,4 +108,4 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
with open(output_path, "w", encoding="utf-8") as _f:
with open(output_path, "w", encoding="utf-8") as _f:
for out_document in out_documents:
for out_document in out_documents:
_f.write(f"{json.dumps(out_document)}\n")
_f.write(json.dumps(out_document) + "\n")
Loading