-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamine.py
77 lines (67 loc) · 1.87 KB
/
examine.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import re
import json
with open('secondary_1000.txt','r',encoding='utf8') as f:
txt = f.read()
exp = re.compile('<RECORD [0-9]+>')
entries = exp.split(txt)[1:]
out = ''
titles = []
data = []
i=0
for entry in entries:
exp = re.compile('Title:(.*)\n')
title = exp.search(entry).groups(0)[0]
unique = not(title in titles)
if unique:
titles.append(title)
# res = scholarly.scholarly.search_single_pub(title)
# res_bib = scholarly.scholarly.bibtex(res)
try:
article = {
# 'id': re.compile('q=info:(.*):').search(res['url_scholarbib']).groups(0)[0],
'id':i,
'title':title,
# 'bib':res_bib,
'abstract':re.compile('Abstract:(.*)\n').search(entry).groups(0)[0],
'tags':[],
'skim_notes':'',
}
except:
article = {
# 'id': re.compile('q=info:(.*):').search(res['url_scholarbib']).groups(0)[0],
'id':i,
'title':title,
# 'bib':res_bib,
'abstract':'none',
'tags':[],
'skim_notes':'',
}
data.append(article)
else:
print(title)
if ('Research on' in title) and ('BIM' in title):
print(title)
print(i)
i+=1
print(len(data))
with open('db.json','w',) as f:
json.dump(data,f,indent=4)
tags = {
'e':'economics/logistics/feasibility',
'b':'bim/digitization',
't':'modular tech',
'd':'design framework',
's':'structural analyses',
'm':'meta/other modular',
1:'priority 1',
2:'priority 2',
3:'priority 3',
}
# economics/logistics/feasibility
# bim/digitization
# construction details
# modular tech
# design frameworks
# structural analyses
# add progress number
# add database with tags and priority and abstract