How to use the arxiv.browse.util.author_affil.parse_author_affil function in arxiv

To help you get started, we’ve selected a few arxiv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
parse_author_affil('Anatoly Zlotnik and Jr-Shin Li'),
            [['Zlotnik', 'Anatoly', ''],
             ['Li', 'Jr-Shin', '']],
            'jr issue (Anatoly Zlotnik and Jr-Shin Li)'
        )

        # ====== Extra tests for arXiv::AuthorAffil ARXIVDEV-728 ======

        # [parse_author_affil]
        self.assertListEqual(
            parse_author_affil(''),
            [],
            'parse_author_affil (empty)'
        )
        self.assertListEqual(
            parse_author_affil('Simeon Warner Jr'),
            [['Warner', 'Simeon', 'Jr']],
            'parse_author_affil (basic) 2/12'
        )
        self.assertListEqual(
            parse_author_affil('BELLE Collaboration'),
            [['BELLE Collaboration', '', '']],
            'parse_author_affil (lone "BELLE Collaboration") 2/3'
        )

        self.assertListEqual(
            parse_author_affil('BELLE Collaboration'),
            [['BELLE Collaboration', '', '']],
            'parse_author_affil (lone "BELLE Collaboration") 2/3'
        )
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
def test_parse_author_affil_basic2(self):
        self.assertListEqual(
            parse_author_affil('S.M. Warner'),
            [['Warner', 'S. M.', '']])

        self.assertListEqual(
            parse_author_affil('John Von Neumann'),
            [['Von Neumann', 'John', '']])

        self.assertListEqual(
            parse_author_affil('Herbert Van de Sompel'),
            [['Van de Sompel', 'Herbert', '']])

        self.assertListEqual(
            parse_author_affil('del Norte'),
            [['Norte', 'del', '']])

        self.assertListEqual(
            parse_author_affil('Fred del Norte'),
            [['del Norte', 'Fred', '']])

        self.assertListEqual(
            parse_author_affil('BELLE'),
            [['BELLE', '', '']])

        self.assertListEqual(
            parse_author_affil('BELLE Collaboration: A Person, Nother Person'),
            [
                ['BELLE Collaboration', '', ''],
                ['Person', 'A', ''],
                ['Person', 'Nother', '']
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
def test_parse_author_affil_with_affiliations(self):
        self.assertListEqual(
            parse_author_affil('sum won (lab a)'),
            [['won', 'sum', '', 'lab a']])

        self.assertListEqual(
            parse_author_affil('sum won (lab a; lab b)'),
            [['won', 'sum', '', 'lab a; lab b']])

        self.assertListEqual(
            parse_author_affil('sum won (lab a, lab b)'),
            [['won', 'sum', '', 'lab a, lab b']])

        self.assertListEqual(
            parse_author_affil('sum won (1,2) ( (1) lab a, (2) lab b)'),
            [['won', 'sum', '', 'lab a', 'lab b']])

        self.assertListEqual(
            parse_author_affil('sum won(1,2)((1)lab a,(2)lab b)'),
            [['won', 'sum', '', 'lab a', 'lab b']])

        self.assertListEqual(
            parse_author_affil('a.b.first, c.d.second (affil)'),
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
parse_author_affil('Fred del Norte'),
            [['del Norte', 'Fred', '']])

        self.assertListEqual(
            parse_author_affil('BELLE'),
            [['BELLE', '', '']])

        self.assertListEqual(
            parse_author_affil('BELLE Collaboration: A Person, Nother Person'),
            [
                ['BELLE Collaboration', '', ''],
                ['Person', 'A', ''],
                ['Person', 'Nother', '']
            ])

        self.assertListEqual(parse_author_affil('The DELPHI Collaboration, J. Abdallah, et al'),
                             [['The DELPHI Collaboration', '', ''], ['Abdallah', 'J.', '']])

        self.assertListEqual(parse_author_affil('Ali Vaziri Astaneh, Federico Fuentes'),
                             [['Vaziri Astaneh', 'Ali', ''],['Fuentes', 'Federico', '']])
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
[['Warner', 'Simeon', 'Jr.']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Sr'),
            [['Warner', 'Simeon', 'Sr']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Sr.'),
            [['Warner', 'Simeon', 'Sr.']])

        self.assertListEqual(
            parse_author_affil('SM Warner'),
            [['Warner', 'SM', '']])

        self.assertListEqual(
            parse_author_affil('SM. Warner'),
            [['Warner', 'SM.', '']])
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
)

        # look like bugs, but aren't
        self.assertListEqual(
            parse_author_affil('sum won ((lab a), (lab b))'),
            [['won', 'sum', '']],
            'parse_author_affil (bug imposter) 1/2'
        )
        self.assertListEqual(
            parse_author_affil('sum won ((lab a) (lab b))'),
            [['won', 'sum', '']],
            'parse_author_affil (bug imposter) 2/2'
        )

        self.assertListEqual(
            parse_author_affil('Anatoly Zlotnik and Jr-Shin Li'),
            [['Zlotnik', 'Anatoly', ''],
             ['Li', 'Jr-Shin', '']],
            'jr issue (Anatoly Zlotnik and Jr-Shin Li)'
        )

        # ====== Extra tests for arXiv::AuthorAffil ARXIVDEV-728 ======

        # [parse_author_affil]
        self.assertListEqual(
            parse_author_affil(''),
            [],
            'parse_author_affil (empty)'
        )
        self.assertListEqual(
            parse_author_affil('Simeon Warner Jr'),
            [['Warner', 'Simeon', 'Jr']],
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
parse_author_affil(
                'Matthew Everitt, Robert M. Heath and Viv Kendon'),
            [['Everitt', 'Matthew', ''],
             ['Heath', 'Robert M.', ''],
             ['Kendon', 'Viv', '']],
            'parse_author_affil for 1110.4366'
        )

        # look like bugs, but aren't
        self.assertListEqual(
            parse_author_affil('sum won ((lab a), (lab b))'),
            [['won', 'sum', '']],
            'parse_author_affil (bug imposter) 1/2'
        )
        self.assertListEqual(
            parse_author_affil('sum won ((lab a) (lab b))'),
            [['won', 'sum', '']],
            'parse_author_affil (bug imposter) 2/2'
        )

        self.assertListEqual(
            parse_author_affil('Anatoly Zlotnik and Jr-Shin Li'),
            [['Zlotnik', 'Anatoly', ''],
             ['Li', 'Jr-Shin', '']],
            'jr issue (Anatoly Zlotnik and Jr-Shin Li)'
        )

        # ====== Extra tests for arXiv::AuthorAffil ARXIVDEV-728 ======

        # [parse_author_affil]
        self.assertListEqual(
            parse_author_affil(''),
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
[['Warner', 'S. M.', '']])

        self.assertListEqual(
            parse_author_affil('John Von Neumann'),
            [['Von Neumann', 'John', '']])

        self.assertListEqual(
            parse_author_affil('Herbert Van de Sompel'),
            [['Van de Sompel', 'Herbert', '']])

        self.assertListEqual(
            parse_author_affil('del Norte'),
            [['Norte', 'del', '']])

        self.assertListEqual(
            parse_author_affil('Fred del Norte'),
            [['del Norte', 'Fred', '']])

        self.assertListEqual(
            parse_author_affil('BELLE'),
            [['BELLE', '', '']])

        self.assertListEqual(
            parse_author_affil('BELLE Collaboration: A Person, Nother Person'),
            [
                ['BELLE Collaboration', '', ''],
                ['Person', 'A', ''],
                ['Person', 'Nother', '']
            ])

        self.assertListEqual(parse_author_affil('The DELPHI Collaboration, J. Abdallah, et al'),
                             [['The DELPHI Collaboration', '', ''], ['Abdallah', 'J.', '']])
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
[['Warner', 'Simeon', 'Jr']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Jr.'),
            [['Warner', 'Simeon', 'Jr.']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Sr'),
            [['Warner', 'Simeon', 'Sr']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Sr.'),
            [['Warner', 'Simeon', 'Sr.']])

        self.assertListEqual(
            parse_author_affil('SM Warner'),
            [['Warner', 'SM', '']])

        self.assertListEqual(
            parse_author_affil('SM. Warner'),
            [['Warner', 'SM.', '']])
github arXiv / arxiv-browse / tests / test_author_affil.py View on Github external
def test_parse_author_affil_basic(self):
        self.assertListEqual(parse_author_affil(
            'Simeon Warner'), [['Warner', 'Simeon', '']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Jr'),
            [['Warner', 'Simeon', 'Jr']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Jr.'),
            [['Warner', 'Simeon', 'Jr.']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Sr'),
            [['Warner', 'Simeon', 'Sr']])

        self.assertListEqual(
            parse_author_affil('Simeon Warner Sr.'),
            [['Warner', 'Simeon', 'Sr.']])

        self.assertListEqual(
            parse_author_affil('SM Warner'),
            [['Warner', 'SM', '']])

        self.assertListEqual(
            parse_author_affil('SM. Warner'),
            [['Warner', 'SM.', '']])