예제 #1
0
    def get_journal(cls, name):
        from papers.pdfget import Journal
        if isinstance(name, Journal):
            return name #already a journal

        name = name.replace("\n"," ")

        from papers.utils import JournalCleanup

        #lower case, strip periods
        name = JournalCleanup.abbreviate(name).replace(".", "").lower()

        if name in cls.abbrevs:
            return cls.get_object(cls.abbrevs[name])
        
        #attempt to object assuming this is the abbreviation
        jobj = cls.get_object(name)
        if jobj:
            return jobj
        
        #nope! no worries!
        abbrev = cls.get_initials(name)
        if abbrev in cls.abbrevs:
            abbrev = cls.abbrevs[abbrev]
        return cls.get_object(abbrev)
예제 #2
0
파일: archive.py 프로젝트: jjwilke/PySkyNet
    def set_journal(self, journal):
        node = self._fetch_node("titles")
        cleanj = clean_line(journal)
        self._set_item(cleanj, self.journaltag, node)

        #and do the abbreviation
        node = self._fetch_node("periodical")
        abbrev = JournalCleanup.abbreviate(journal)
        self._set_item(abbrev, self.abbrevtag, node)
예제 #3
0
파일: pdfget.py 프로젝트: jjwilke/PySkyNet
 def set_journal(self, journal):
     from papers.utils import JournalCleanup
     self.journal = JournalCleanup.abbreviate(journal)
예제 #4
0
파일: pybib.py 프로젝트: jjwilke/PySkyNet
 def bibitem(self, obj, simple=False):
     from papers.utils import JournalCleanup
     journal = JournalCleanup.abbreviate(obj.text())
     text = LatexFormat.format(self.style, journal)
     return text