-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdict_sources.py
47 lines (29 loc) · 962 Bytes
/
dict_sources.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 general import *
import add_path
from global_hiero import *
from mine_tle import tle_entry, tle_file
class dct_sourcescl:
def __init__(self):
self.dct = pi.open_pickle('tle_dct6','hi')
st = defaultdict(int)
for x in self.dct.values():
lst = vgf.strip_n_split(x.main_source, ";")
for y in lst:
lst1 = vgf.strip_n_split(y, ",")
z = lst1[0]
if reg(r'^(v|V)gl.', z):
z = z[4:].strip()
if z.startswith("Van"):
try:
idx = z[5:].index(" ")
st[z[:idx + 5]] += 1
except:
pass
elif " " in z:
idx = z.index(" ")
st[z[:idx]] += 1
else:
st[z] += 1
st = sort_dct_val_rev(st)
return
dct_sourcescl()