-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.py
More file actions
49 lines (44 loc) · 1021 Bytes
/
controller.py
File metadata and controls
49 lines (44 loc) · 1021 Bytes
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
import json
import os,sys
from crawler import Crawler
from sentiment import Sentiment
from associate import Associate
from community import Community
try:
inp = open("config.json","r")
config = json.load(inp)
except OSError as e:
print('error locating file',e)
sys.exit()
except json.JSONDecodeError as e:
print('error reading JSON',e)
sys.exit()
if config["getData"]:
try:
crawler = Crawler(config)
#crawler.crawl()
print('crawled')
except:
print('Issue with web crawler', sys.exc_info())
sys.exit()
try:
classifier = Sentiment(config)
classifier.classify()
print('classified')
except:
print('Issue with sentiment analyser', sys.exc_info())
sys.exit()
try:
associator = Associate(config)
associator.associate()
print('associated')
except:
print('Issue with association', sys.exc_info())
sys.exit()
try:
community = Community(config)
community.communities()
print('communities stored')
except:
print('Issue with community detection', sys.exc_info())
sys.exit()