Skip to content
Snippets Groups Projects
Commit 3130c89d authored by Jakub-Goluch's avatar Jakub-Goluch
Browse files

Add feature to check whether document has a valid json/jsonl format, add tests

parent b5554f3e
1 merge request!4Resolve "Read not only .txt files"
Pipeline #11289 passed with stages
in 7 minutes and 17 seconds
...@@ -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(json.dumps(document) + "\n") _f.write(json.dumps(document) + "\n")
def process( def process(
self, self,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment