-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclassifier.py
49 lines (42 loc) · 1.53 KB
/
classifier.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
flags = []
classes = dict()
classes["unclassified"] = []
classes["python"] = []
classes["abi"] = []
classes["ruby"] = []
classes["databases"] = []
classes["documentation"] = []
classes["core_os"] = []
classes["dev_features"] = []
classes["x11"] = []
with open("./graphviz-output/graph_limit50_labeled_cleaned.gv") as graph:
lines = graph.readlines()
for line in lines[1:]:
if ('--' in line) or ('}' in line):
continue # we do not care about edges currently
if ("python" in line) or ("pip" in line):
classes["python"].append(line.strip())
continue
if ('abi' in line):
classes["abi"].append(line.strip())
continue
if ('ruby' in line):
classes["ruby"].append(line.strip())
continue
if ('postgres' in line) or ('mysql' in line):
classes["databases"].append(line.strip())
continue
if ('doc' in line) or ('handbook' in line):
classes["documentation"].append(line.strip())
continue
if ('elibc' in line) or ('kernel' in line) or ('introspection' in line) or ("systemd" in line):
classes["core_os"].append(line.strip())
continue
if ("debug" in line) or ('test' in line):
classes["dev_features"].append(line.strip())
continue
if ("X" in line) or ("static-libs" in line):
classes["x11"].append(line.strip())
continue
classes["unclassified"].append(line.strip())
print(classes)