Ejemplo n.º 1
0
def _compare_names(bib1, bib2):
    metadata_comparison_print("Comparing names.")

    name1 = get_name_by_bibrecref(bib1)
    name2 = get_name_by_bibrecref(bib2)

    if name1 and name2:
        return compare_names(name1, name2, False)
    return "?"
def _compare_names(bibs1, bibs2):
    comparison_log("Comparing names.")
    def _find_names(bibs):
        return [get_name_by_bibrecref(bib) for bib in bibs]

    names1 = _find_names(bibs1)
    names2 = _find_names(bibs2)

    all_pairs = [compare_names(n1, n2) for n1 in names1 for n2 in names2]
    comparison_log("Total pairs: %d." % len(all_pairs))

    if all_pairs:
        comparison_log("Result vector: %s." % all_pairs[0:50])
        return sum(all_pairs) / len(all_pairs)
    else:
        return '?'
Ejemplo n.º 3
0
def _compare_names(bibs1, bibs2):
    comparison_log("Comparing names.")

    def _find_names(bibs):
        return [get_name_by_bibrecref(bib) for bib in bibs]

    names1 = _find_names(bibs1)
    names2 = _find_names(bibs2)

    all_pairs = [compare_names(n1, n2) for n1 in names1 for n2 in names2]
    comparison_log("Total pairs: %d." % len(all_pairs))

    if all_pairs:
        comparison_log("Result vector: %s." % all_pairs[0:50])
        return sum(all_pairs) / len(all_pairs)
    else:
        return '?'