Skip to content
Snippets Groups Projects
Commit 1b870251 authored by Mateusz Gniewkowski's avatar Mateusz Gniewkowski
Browse files

Merge branch 'developer' into 'master'

Add en, ru, uk language.

See merge request !1
parents 1a1bbf58 15cca73b
Branches
Tags
1 merge request!1Add en, ru, uk language.
Pipeline #3005 passed with stages
in 2 minutes and 48 seconds
......@@ -14,14 +14,17 @@ class Speller2Worker(nlp_ws.NLPWorker):
def static_init(cls, config):
"""One time static initialisation."""
_log.log(logging.INFO, "Worker started loading static models ")
cls._model = Speller('pl')
cls._model = {'pl': Speller('pl'),
'ru': Speller('ru'),
'en': Speller('en'),
'uk': Speller('uk')}
_log.log(logging.INFO, "Worker finished loading static models ")
def process(self, input_file, task_options, output_file):
"""Starting nlp process."""
_log.info("Processing")
model = self._model
language = task_options.get('lang', 'pl')
model = self._model.get(language)
data = self._read_file(input_file)
......
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