filter.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class Filter(object):
  2. def getTitle (self, csvRow):
  3. return csvRow[self.getTitleField()]
  4. def getAbstract (self, csvRow):
  5. return csvRow[self.getAbstractField()]
  6. def getAuthors (self, csvRow):
  7. return csvRow[self.getAuthorsField()]
  8. def getKeywordExtra (self, csvRow):
  9. if self.getKeywordExtraField() in csvRow:
  10. return csvRow[self.getKeywordExtraField()]
  11. else:
  12. return ''
  13. def getKeyword (self, csvRow):
  14. return csvRow[self.getKeywordField()]
  15. def getDOI (self, csvRow):
  16. return csvRow[self.getDOIField()]
  17. def getCSVData (self, csvRow):
  18. title = self.getTitle(csvRow)
  19. authors = self.getAuthors(csvRow)
  20. abstract = self.getAbstract(csvRow)
  21. keyword = self.getKeyword(csvRow)
  22. doi = self.getDOI(csvRow)
  23. keywordExtra = self.getKeywordExtra(csvRow)
  24. return [title, abstract, authors, doi, keyword, keywordExtra]
  25. def getAbstractField (self):
  26. raise NotImplementedError
  27. def getTitleField (self):
  28. raise NotImplementedError
  29. def getAuthorsField (self):
  30. raise NotImplementedError
  31. def getKeywordField (self):
  32. raise NotImplementedError
  33. def getKeywordExtraField (self):
  34. raise NotImplementedError
  35. def getDOIField (self):
  36. raise NotImplementedError