Skip to content

Commit

Permalink
Multiple ways to match
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Feb 21, 2013
1 parent 5c4796f commit e4b62a8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions dblp/prepare/matchAuthors2.py
@@ -0,0 +1,35 @@
#! /usr/bin/env python
import sys

buf = 300000

# reverse author-of
rao = {}

ao = open('../cache/authorOf.rdf','r')
tmplines = ao.readlines(buf)
cx = 1
while tmplines:
for line in tmplines:
c = line.split('"')
if c[3] not in rao.keys():
rao[c[3]] = []
rao[c[3]].append(c[1])
print 'Processed', cx*buf, 'lines...'
tmplines = ao.readlines(buf)
cx += 1
ao.close()

print 'AuthorOf read!'

ps = open('pi.all','r')
ass = open('ai2.all','w')
for line in ps.readlines():
paper = line.strip()
if paper in rao.keys():
for a in rao[paper]:
ass.write('%s\n' % a)
else:
print 'Unknown paper:',paper
ps.close()
ass.close()

0 comments on commit e4b62a8

Please sign in to comment.