/
Main_bank.py
47 lines (37 loc) · 1.12 KB
/
Main_bank.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from crawler import Crawler
from Url import Url
from UrlBank import UrlBank
from PageRank import PageRank
from Tokenizer import Tokenizer
from Index import Index
from Scorer import Scorer
def main():
crawler = Crawler([
"http://people.f4.htw-berlin.de/fileadmin/user_upload/Dozenten/WI-Dozenten/Classen/DAWeb/smdocs/d01.html",
"http://people.f4.htw-berlin.de/fileadmin/user_upload/Dozenten/WI-Dozenten/Classen/DAWeb/smdocs/d06.html",
"http://people.f4.htw-berlin.de/fileadmin/user_upload/Dozenten/WI-Dozenten/Classen/DAWeb/smdocs/d08.html"
])
crawler.crawl()
bank = crawler.get_bank()
bank.sortBank()
print '\nLinkstruktur: \n'
bank.printOutgoing()
print '\nPageRanks:'
rank = PageRank(bank, 0.95, 0.04)
rank.calculate()
print '\n\nIndex: \n'
i = Index( bank )
i.printIndex()
s = Scorer( 'tokens', i )
print '\nDokumentenlaenge: \n'
s.printDocumentLength()
print '\nSuchergebnisse: \n'
s.printScoring()
s = Scorer( 'index', i )
s.printScoring()
s = Scorer( 'classification', i )
s.printScoring()
s = Scorer( 'tokens classification', i )
s.printScoring()
if __name__ == "__main__":
main()