Skip to content
Snippets Groups Projects

Add en, ru, uk language.

Merged Ghost User requested to merge developer into master
Compare and
1 file
+ 6
3
Compare changes
  • Side-by-side
  • Inline
+ 6
3
@@ -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)