Ejemplo n.º 1
0
def test_compute_author_match_one_empty_list():
    x_authors = []
    y_authors = [
        {
            'full_name': 'Kobayashi, Makoto'
        },
        {
            'full_name': 'Maskawa, Toshihide'
        },
    ]

    result = compute_author_match_score(x_authors, y_authors)

    assert result == 0.0
Ejemplo n.º 2
0
def test_compute_author_match_score_different_authors():
    x_authors = [{
        'full_name': 'Cabibbo, Nicola'
    }, {
        'full_name': 'Kobayashi, Makoto'
    }, {
        'full_name': 'Maskawa, Toshihide'
    }, {
        'full_name': 'Smith, John'
    }]
    y_authors = [
        {
            'full_name': 'Sinatra, Mary'
        },
        {
            'full_name': 'Blueds, Michael'
        },
    ]

    result = compute_author_match_score(x_authors, y_authors)

    assert result == 0.0
Ejemplo n.º 3
0
def test_compute_author_match_score_similar_authors():
    x_authors = [{
        'full_name': 'Cabibbo, Nicola'
    }, {
        'full_name': 'Kobayashi, Makoto'
    }, {
        'full_name': 'Maskawa, Toshihide'
    }, {
        'full_name': 'Smith, John'
    }]
    y_authors = [
        {
            'full_name': 'Kobayashi, Makoto'
        },
        {
            'full_name': 'Maskawa, Toshihide'
        },
    ]

    result = compute_author_match_score(x_authors, y_authors)

    assert result == 0.5