Пример #1
0
def test():
    ''' does everything, prints top 10 results. needs page.sql and pagelinks.sql 
    files which can be downloaded using download_and_extract.sh '''
    make_title_ID_dicts.main()
    make_graph.main()
    compactify.main()
    pagerank.main()
Пример #2
0
def test():
    ''' does everything, prints top 10 results. needs page.sql and pagelinks.sql 
    files which can be downloaded using download_and_extract.sh '''
    make_title_ID_dicts.main()
    make_graph.main()
    compactify.main()
    pagerank.main()
Пример #3
0
def actual(outfile='pageranked.txt'):
    ''' does everything and writes all results to file '''
    make_title_ID_dicts.main(out_dir=out_dir)
    make_graph.main(out_dir=out_dir)
    compactify.main(out_dir=out_dir)
    with open(out_dir + outfile, 'w') as f:
        for page in pagerank.top_k(-1):
            f.write(page + '\n')
Пример #4
0
def actual(outfile='pageranked.txt'):
    ''' does everything and writes all results to file '''
    make_title_ID_dicts.main()
    make_graph.main()
    compactify.main()
    with open(outfile, 'w') as f:
        pr_results = pagerank.top_k(-1)
        print 'saving PR results'
        for page in pr_results:
            f.write(page + '\n')
        print 'done saving!'
Пример #5
0
def actual(outfile='data/pageranked.txt'):
    ''' does everything and writes all results to file '''
    make_title_ID_dicts.main()
    make_graph.main()
    compactify.main()
    with open(outfile, 'w') as f:
        pr_results = pagerank.top_k(-1)
        print 'saving PR results'
        for page in pr_results:
            f.write(page + '\n')
        print 'done saving!'