From 0a7a861cc113c5e9d4695e704b54bc65037aa1e6 Mon Sep 17 00:00:00 2001 From: Kamil Kanclerz <kamil.kanclerz@e-science.pl> Date: Sat, 16 Jan 2021 00:16:27 +0100 Subject: [PATCH] Remove unused imports --- src/speller2_worker.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/speller2_worker.py b/src/speller2_worker.py index 1729723..95efe00 100755 --- a/src/speller2_worker.py +++ b/src/speller2_worker.py @@ -1,6 +1,4 @@ """Implementation of nlp_worker.""" -import io -import json import logging import nlp_ws @@ -26,16 +24,12 @@ class Speller2Worker(nlp_ws.NLPWorker): model = self._model data = self._read_file(input_file) - print(data.split('\n')) + corrected_data = [model(line) for line in data.split('\n')] with open(output_file, 'w', encoding='utf-8') as f: f.write('\n'.join(corrected_data)) - #with io.open(output_file, 'w', encoding='utf-8') as f: - #json.dump(corrected_data, f, ensure_ascii=False) - #for line in corrected_data: - @classmethod def _read_file(cls, input_path): """Reading text from input file.""" -- GitLab