]> code.communitydata.science - covid19.git/blobdiff - transliterations/src/wikidata_transliterations.py
Loading data directly from github URL. Commenting out commands that assume cloned...
[covid19.git] / transliterations / src / wikidata_transliterations.py
index d878354876bc10fd229fc1bd0959c2518f3fe2e1..0856c9cc01d132cd2825522c06ac850eaa48c4f9 100644 (file)
@@ -23,7 +23,7 @@ def GetAllLabels(in_csvs, outfile, topNs):
 
     def load_entity_ids(in_csv, topN=5):
         with open(in_csv,'r',newline='') as infile:
 
     def load_entity_ids(in_csv, topN=5):
         with open(in_csv,'r',newline='') as infile:
-            reader = csv.DictReader(infile)
+            reader = list(csv.DictReader(infile))
             for row in reader:
                 if int(row['search_position']) < topN:
                     yield row["entityid"]
             for row in reader:
                 if int(row['search_position']) < topN:
                     yield row["entityid"]

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