Beispiel #1
0
 def test_load(self):
     pubs, stats = gs.parse_gs_page(open(self.test_file).read())
     self.assertEqual(stats["citations"], 7780)
     self.assertEqual(stats["h-index"], 37)
     self.assertEqual(stats["i10-index"], 77)
     self.assertEqual(len(pubs), 100)
     self.assertEqual(
         pubs[0]["title"],
         "Method and system for searching for information on a network in response to an image query sent by a user from a mobile communications device",
     )
     self.assertEqual(pubs[0]["authors"], "GD Ramkumar, R Manmatha, S Bhattacharyya, G Bhargava, MA Ruzon")
     self.assertEqual(pubs[0]["year"], 2015)
Beispiel #2
0
 def test_load(self):
     pubs, stats = gs.parse_gs_page(open(self.test_file).read())
     self.assertEqual(stats['citations'], 7780)
     self.assertEqual(stats['h-index'], 37)
     self.assertEqual(stats['i10-index'], 77)
     self.assertEqual(len(pubs), 100)
     self.assertEqual(
         pubs[0]['title'],
         'Method and system for searching for information on a network in response to an image query sent by a user from a mobile communications device'
     )
     self.assertEqual(
         pubs[0]['authors'],
         'GD Ramkumar, R Manmatha, S Bhattacharyya, G Bhargava, MA Ruzon')
     self.assertEqual(pubs[0]['year'], 2015)
                continue
            else:
                skipping = False

        #if f['facultyName'] != 'Aravind Srinivasan':
        #    continue 

        # Check for each profile, download if missing
        if 'gs' in f and args.gs_dir is not None:
            num_loaded = 0
            gs_file = os.path.join(args.gs_dir, GS_FILE % (f['gs'], num_loaded))
            all_pubs = []
            stats = None

            while os.path.isfile(gs_file):
                pubs, stats = parse_gs_page(open(gs_file).read())
                all_pubs += pubs
                num_loaded += 1
                gs_file = os.path.join(args.gs_dir, GS_FILE % (f['gs'], num_loaded))

            output_file = os.path.join(args.gs_dir, GS_PKL % f['gs']) 
            with open(output_file,'wb') as fp:
                pickle.dump(all_pubs, fp)
                pickle.dump(stats, fp)
            
        if 'dblp' in f and args.dblp_dir is not None:
            dblp_file = os.path.join(args.dblp_dir, DBLP_FILE % (f['dblp'], 0))
            all_pubs, stats = parse_dblp_page(open(dblp_file).read())

            for pub in all_pubs:
                role = get_author_role(f.facultyName, pub['authors'])