Commit 80179254 authored by Marko Kollo's avatar Marko Kollo 😄
Browse files

"Fix" for processing list values.

parent f28545be
Pipeline #6259 passed with stage
in 9 minutes and 41 seconds
......@@ -10,12 +10,11 @@ import regex as re
import stanza
from bs4 import BeautifulSoup
from langdetect import detect
from pelecanus import PelicanJson
from texta_mlp.document import Document
from texta_mlp.entity_mapper import EntityMapper
from texta_mlp.utils import parse_bool_env
from texta_mlp.exceptions import LanguageNotSupported
from texta_mlp.utils import parse_bool_env
# Languages supported by default.
......@@ -354,7 +353,7 @@ class MLP:
lang_group = {}
texts = [Document.parse_doc(doc_path, document) for document in docs]
for index, text in enumerate(texts):
text = text[0] if text and len(text) == 1 else text
text = text[0] if text else ""
lang = self.detect_language(text)
if lang not in self.supported_langs:
lang = self.default_lang
......
Markdown is supported
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