Exemple #1
0
def get_links(pkg, es):
    texts = get_text_content(pkg)
    # print texts
    cands = Counter()
    for (text, weight) in texts:
        # print "Weight:", weight
        # print "Text:", text, '\n'
        result = stringmatch.link_algorithm(text, es)
        # print result
        for (algo, score) in result:
            cands[algo] += score * weight

    impls = []
    for (algo, score) in cands.most_common():
        print algo, score
        if match_valid(algo, score):
            impls.append(algo)
    return impls
Exemple #2
0
def get_links(pkg, es):
    texts = get_text_content(pkg)
    # print texts
    cands = Counter()
    for (text, weight) in texts:
        # print "Weight:", weight
        # print "Text:", text, '\n'
        result = stringmatch.link_algorithm(text, es)
        # print result
        for (algo, score) in result:
            cands[algo] += score * weight

    impls = []
    for (algo, score) in cands.most_common():
        print algo, score
        if match_valid(algo, score):
            impls.append(algo)
    return impls
Exemple #3
0
def test_query(desp):
    from pprint import pprint
    pprint(stringmatch.link_algorithm(desp, es), width=1)
Exemple #4
0
def test_query(desp):
    from pprint import pprint
    pprint(stringmatch.link_algorithm(desp, es), width=1)