Skip to content

Commit

Permalink
Produce cached lists of community and network members
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Jan 27, 2013
1 parent 5513beb commit 668b7ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dblp/community.py
Expand Up @@ -24,17 +24,25 @@
tmplines = pa.readlines(buf)
pa.close()

total = []
years = {}
for n in names.keys():
y = n.replace('/','').replace('-','')
for x in range(ord('a'),ord('z')+1):
y = y.replace(chr(x),'')
y = y[0:4]
y = int(y[0:4])
if y not in years:
years[y] = []
for name in names[n]:
if name not in years[y]:
years[y].append(name)
if name not in total:
total.append(name)

for y in sorted(years.keys()):
print y,' ',len(years[y])

comm = open('rdf/community.1','w')
for name in sorted(total):
comm.write('%s\n' % name)
comm.close()
3 changes: 3 additions & 0 deletions dblp/network.py
Expand Up @@ -41,17 +41,20 @@
extyears[y] = years[y][:]

cw = open('rdf/collabWith.txt','r')
net = open('rdf/network.unsorted','w')
tmplines = cw.readlines(buf)
while tmplines:
for line in tmplines:
x,r,y = line.strip().split('"')[1:4]
if r == ' collaboratedWith ':
for yr in years.keys():
net.write('%s\n' % y)
if x in years[yr]:
if y not in extyears[yr]:
extyears[yr].append(y)
tmplines = cw.readlines(buf)
cw.close()
net.close()

for y in sorted(years.keys()):
print y,' ',len(extyears[y])

0 comments on commit 668b7ac

Please sign in to comment.