]> code.communitydata.science - covid19.git/blobdiff - transliterations/src/wikidata_search.py
Merge pull request #7 from kayleachampion/master
[covid19.git] / transliterations / src / wikidata_search.py
index 21e8598a2045f3cbdafb09bef848ff57adcd0116..a3abbc0d800732298cc6481261dc967945586a18 100644 (file)
@@ -68,12 +68,12 @@ def read_google_trends_files(terms_files):
 
 
 def trawl_google_trends(terms_files, outfile = None, mode='w'):
 
 
 def trawl_google_trends(terms_files, outfile = None, mode='w'):
-    terms = read_google_trends_files(terms_files)
+    terms = list(read_google_trends_files(terms_files))
     resultset = run_wikidata_searches(terms)
     resultset.to_csv(outfile, mode)
 
 def trawl_base_terms(infiles, outfile = None, mode='w'):
     resultset = run_wikidata_searches(terms)
     resultset.to_csv(outfile, mode)
 
 def trawl_base_terms(infiles, outfile = None, mode='w'):
-    terms = chain(* (open(infile,'r') for infile in infiles))
+    terms = list(chain(* (open(infile,'r') for infile in infiles)))
     resultset = run_wikidata_searches(terms)
     resultset.to_csv(outfile, mode)
 
     resultset = run_wikidata_searches(terms)
     resultset.to_csv(outfile, mode)
 

Community Data Science Collective || Want to submit a patch?