Fix check_encoding functionality

This commit is contained in:
Stephan Porada 2020-02-12 14:16:36 +01:00
parent 504861ae07
commit 1a3e4a0a02
2 changed files with 5 additions and 5 deletions

6
nlp
View File

@ -60,7 +60,7 @@ class NLPWorkflow(WorkflowRunner):
self.n_cores = args.n_cores
self.output_dir = args.output_dir
self.zip = args.zip
self.check_encoding
self.check_encoding = args.check_encoding
def workflow(self):
if len(self.jobs) == 0:
@ -95,8 +95,8 @@ class NLPWorkflow(WorkflowRunner):
cmd = 'spacy_nlp -l "{}" "{}" "{}" "{}"'.format(
self.lang,
job['path'],
os.path.join(job['output_dir'], job['name'] + '.vrt',
if self.check_encoding "--check-encoding" else "")
os.path.join(job['output_dir'], job['name'] + '.vrt'),
"--check-encoding" if self.check_encoding else ""
)
nlp_jobs.append(
self.addTask(

View File

@ -3,7 +3,7 @@
from xml.sax.saxutils import escape
import argparse
import os
import chardet
import spacy
import textwrap