Example #1
0
def delayed_cluster_sets_from_marktables(limit_to_surnames=False):
    # { name -> [(table, bibref)] }
    bibauthor_print('Delayed_cluster_set_from_marktables limited to %s' %
                    str(limit_to_surnames))

    name_buket = {}
    if limit_to_surnames:
        limit_to_surnames = set(
            [generate_last_name_cluster_str(s) for s in limit_to_surnames])

    for tab, ref, name in chain(izip(cycle((100, )), *izip(*get_bib10x())),
                                izip(cycle((700, )), *izip(*get_bib70x()))):
        name = generate_last_name_cluster_str(name)
        if limit_to_surnames and not name in limit_to_surnames:
            continue
        name_buket[name] = name_buket.get(name, []) + [(tab, ref)]

    bibauthor_print(
        'Delayed_cluster_set_from_marktables going to get %s  signatures....' %
        str(len(name_buket)))

    all_refs = ((name, refs, len(list(get_signatures_from_bibrefs(refs))))
                for name, refs in name_buket.items())
    all_refs = sorted(all_refs, key=itemgetter(2))
    return ([
        delayed_create_from_mark(set(refs), name) for name, refs, _ in all_refs
    ], map(itemgetter(0), all_refs), map(itemgetter(2), all_refs))
Example #2
0
def delayed_cluster_sets_from_marktables():
    # { name -> [(table, bibref)] }
    name_buket = {}
    for tab, ref, name in chain(izip(cycle((100,)), *izip(*get_bib10x())),
                                izip(cycle((700,)), *izip(*get_bib70x()))):
        name = generate_last_name_cluster_str(name)
        name_buket[name] = name_buket.get(name, []) + [(tab, ref)]

    all_refs = ((name, refs, len(list(get_signatures_from_bibrefs(refs))))
                for name, refs in name_buket.items())
    all_refs = sorted(all_refs, key=itemgetter(2))
    return ([delayed_create_from_mark(refs, name) for name, refs, _ in all_refs],
             map(itemgetter(0), all_refs),
             map(itemgetter(2), all_refs))
def delayed_cluster_sets_from_marktables(limit_to_surnames=False):
    # { name -> [(table, bibref)] }
    bibauthor_print('Delayed_cluster_set_from_marktables limited to %s' % str(limit_to_surnames))

    name_buket = {}
    if limit_to_surnames:
        limit_to_surnames = set([generate_last_name_cluster_str(s) for s in limit_to_surnames])

    for tab, ref, name in chain(izip(cycle((100,)), *izip(*get_bib10x())),
                                izip(cycle((700,)), *izip(*get_bib70x()))):
        name = generate_last_name_cluster_str(name)
        if limit_to_surnames and not name in limit_to_surnames:
            continue
        name_buket[name] = name_buket.get(name, []) + [(tab, ref)]

    bibauthor_print('Delayed_cluster_set_from_marktables going to get %s  signatures....' % str(len(name_buket)))

    all_refs = ((name, refs, len(list(get_signatures_from_bibrefs(refs))))
                for name, refs in name_buket.items())
    all_refs = sorted(all_refs, key=itemgetter(2))
    return ([delayed_create_from_mark(set(refs), name) for name, refs, _ in all_refs],
             map(itemgetter(0), all_refs),
             map(itemgetter(2), all_refs))