コード例 #1
0
ファイル: index_pkg.py プロジェクト: xkxx/algodb
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
コード例 #2
0
ファイル: index_pkg.py プロジェクト: geitje01/algodb
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
コード例 #3
0
ファイル: index_pkg.py プロジェクト: xkxx/algodb
def test_query(desp):
    from pprint import pprint
    pprint(stringmatch.link_algorithm(desp, es), width=1)
コード例 #4
0
ファイル: index_pkg.py プロジェクト: geitje01/algodb
def test_query(desp):
    from pprint import pprint
    pprint(stringmatch.link_algorithm(desp, es), width=1)