def __init__(<EOL>self,<EOL>structural,<EOL>blacklist,<EOL>flatten,<EOL>lingual,<EOL>strip,<EOL>replacements,<EOL>tabular,<EOL>visual,<EOL>pdf_path,<EOL>language,<EOL>**kwargs,<EOL>):
super(ParserUDF, self).__init__(**kwargs)<EOL>self.structural = structural<EOL>self.blacklist = blacklist if isinstance(blacklist, list) else [blacklist]<EOL>self.flatten = flatten if isinstance(flatten, list) else [flatten]<EOL>self.language = language<EOL>self.strip = strip<EOL>self.replacements = []<EOL>for (pattern, replace) in replacements:<EOL><INDENT>self.replacements.append((re.compile(pattern, flags=re.UNICODE), replace))<EOL><DEDENT>self.lingual = lingual<EOL>self.lingual_parser = Spacy(self.language)<EOL>if self.lingual_parser.has_tokenizer_support():<EOL><INDENT>self.tokenize_and_split_sentences = self.lingual_parser.split_sentences<EOL>self.lingual_parser.load_lang_model()<EOL><DEDENT>else:<EOL><INDENT>self.tokenize_and_split_sentences = SimpleTokenizer().parse<EOL><DEDENT>if self.lingual:<EOL><INDENT>if self.lingual_parser.has_NLP_support():<EOL><INDENT>self.enrich_tokenized_sentences_with_nlp = (<EOL>self.lingual_parser.enrich_sentences_with_NLP<EOL>)<EOL><DEDENT>else:<EOL><INDENT>logger.warning(<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>)<EOL>self.lingual = False<EOL><DEDENT><DEDENT>self.tabular = tabular<EOL>self.visual = visual<EOL>if self.visual:<EOL><INDENT>self.pdf_path = pdf_path<EOL>self.vizlink = VisualLinker()<EOL><DEDENT>
:param visual: boolean, if True visual features are used in the model
:param pdf_path: directory where pdf are saved, if a pdf file is not
    found, it will be created from the html document and saved in that
    directory
:param replacements: a list of (_pattern_, _replace_) tuples where
    _pattern_ isinstance a regex and _replace_ is a character string.
    All occurents of _pattern_ in the text will be replaced by
    _replace_.