Skip to content
Snippets Groups Projects
Commit 0a7a861c authored by Kamil Kanclerz's avatar Kamil Kanclerz
Browse files

Remove unused imports

parent b654f6d6
No related branches found
No related tags found
No related merge requests found
Pipeline #2299 passed
"""Implementation of nlp_worker.""" """Implementation of nlp_worker."""
import io
import json
import logging import logging
import nlp_ws import nlp_ws
...@@ -26,16 +24,12 @@ class Speller2Worker(nlp_ws.NLPWorker): ...@@ -26,16 +24,12 @@ class Speller2Worker(nlp_ws.NLPWorker):
model = self._model model = self._model
data = self._read_file(input_file) data = self._read_file(input_file)
print(data.split('\n'))
corrected_data = [model(line) for line in data.split('\n')] corrected_data = [model(line) for line in data.split('\n')]
with open(output_file, 'w', encoding='utf-8') as f: with open(output_file, 'w', encoding='utf-8') as f:
f.write('\n'.join(corrected_data)) 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 @classmethod
def _read_file(cls, input_path): def _read_file(cls, input_path):
"""Reading text from input file.""" """Reading text from input file."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment