Ejemplo n.º 1
0
 def init_parser_of_type(self):
     """ Initialize the appropriate parser specified in the configuration file """
     type_ = self.cfg['parser_type']
     if type_ == 'default':
         self.article_parser = DefaultArticleParser(self)
     elif type_ == 'langnames':
         self.article_parser = ArticleParserWithLangnames(self)
     elif type_ == 'section_level':
         self.article_parser = SectionAndArticleParser(self)
     else:
         raise NotImplementedError("Parser type " + str(type_) +
                                   " not implemented\n")