Don't process files in subdirectories

This commit is contained in:
Patrick Jentsch 2021-04-12 13:24:31 +02:00
parent 4e7669d009
commit cd976692d6

5
nlp
View File

@ -128,9 +128,8 @@ def collect_jobs(input_dir, output_dir):
jobs = []
for file in os.listdir(input_dir):
if os.path.isdir(os.path.join(input_dir, file)):
jobs += collect_jobs(os.path.join(input_dir, file),
os.path.join(output_dir, file))
elif file.lower().endswith('.txt'):
continue
if file.lower().endswith('.txt'):
job = NLPPipelineJob(os.path.join(input_dir, file),
os.path.join(output_dir, file))
jobs.append(job)