def load_paper_text_data(self): """populates the paper objects with corresponding paper text""" print "Loading paper text" paperTextFiles = list_files(self.papersPath) for paperTextFile in paperTextFiles: paperTextFileReader = open(paperTextFile, 'r') paperFileName = paperTextFile.split('/')[len(paperTextFile.split('/')) - 1] paperId = paperFileName.split('.')[0] if self.paperInfo.has_key(paperId): currentPaperInfo = self.paperInfo[paperId] currentPaperInfo[self.paperFields.PAPER_TEXT] = paperTextFileReader.read() paperTextFileReader.close()
def load_citation_summary(self): """populates the paper objects with corresponding citation summaries""" print "Loading citation summaires" citationFiles = list_files(self.citationSummaryPath) for citationFile in citationFiles: citationFileReader = open(citationFile, 'r') citationFileName = citationFile.split('/')[len(citationFile.split('/')) - 1] paperId = citationFileName.split('.')[0] if self.paperInfo.has_key(paperId): currentPaperInfo = self.paperInfo[paperId] currentPaperInfo[self.paperFields.CITATION_SUMMARY] = citationFileReader.read() citationFileReader.close()