def fix_journal_name(journal, knowledge_base):
if not journal:<EOL><INDENT>return '<STR_LIT>', '<STR_LIT>'<EOL><DEDENT>if not knowledge_base:<EOL><INDENT>return journal, '<STR_LIT>'<EOL><DEDENT>if len(journal) < <NUM_LIT:2>:<EOL><INDENT>return journal, '<STR_LIT>'<EOL><DEDENT>volume = '<STR_LIT>'<EOL>if (journal[-<NUM_LIT:1>] <= '<STR_LIT>' and journal[-<NUM_LIT:1>] >= '<STR_LIT:A>')and (journal[-<NUM_LIT:2>] == '<STR_LIT:.>' or journal[-<NUM_LIT:2>] == '<STR_LIT:U+0020>'):<EOL><INDENT>volume += journal[-<NUM_LIT:1>]<EOL>journal = journal[:-<NUM_LIT:1>]<EOL><DEDENT>journal = journal.strip()<EOL>if journal.upper() in knowledge_base:<EOL><INDENT>journal = knowledge_base[journal.upper()].strip()<EOL><DEDENT>elif journal in knowledge_base:<EOL><INDENT>journal = knowledge_base[journal].strip()<EOL><DEDENT>elif '<STR_LIT:.>' in journal:<EOL><INDENT>journalnodots = journal.replace('<STR_LIT>', '<STR_LIT:U+0020>')<EOL>journalnodots = journalnodots.replace('<STR_LIT:.>', '<STR_LIT:U+0020>').strip().upper()<EOL>if journalnodots in knowledge_base:<EOL><INDENT>journal = knowledge_base[journalnodots].strip()<EOL><DEDENT><DEDENT>journal = journal.replace('<STR_LIT>', '<STR_LIT:.>')<EOL>return journal, volume<EOL>
Convert journal name to Inspire's short form.