예제 #1
0
 def output_pure_article(self, article, subject):
     self.article = os.path.join(self.inPath, subject, article)
     self.tree = Articles.parse_XML_no_Table(self.article)
     self.body = self.get_article_body_text(self.tree)
     self.sentences = self.tokenize_text(self.body)
     self.doi = Articles.extract_element(self.tree, "front/article-meta/article-id")
     if not os.path.exists(os.path.join(self.outPath, subject)):
         sys.stderr.write("creating directory %s\n" % os.path.join(self.outPath, subject))
         os.mkdir(os.path.join(self.outPath, subject))
     
     self.write(os.path.join(self.outPath, subject))