Exemplo n.º 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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
 def set_journal(self, journal):
     from papers.utils import JournalCleanup
     self.journal = JournalCleanup.abbreviate(journal)
Exemplo n.º 4
0
 def bibitem(self, obj, simple=False):
     from papers.utils import JournalCleanup
     journal = JournalCleanup.abbreviate(obj.text())
     text = LatexFormat.format(self.style, journal)
     return text