def count_entries(file_list):
"""Performs a count of the number of number of words in the corpus
Args:
file_list (list): list of file names.
Returns:
list: A list of json objects containing the count per file name
"""
result = []
for obj in file_list:
with open(CSV_PATH + obj + '.csv', "r") as entry:
reader = csv.reader(entry, delimiter=",")
col_count = len(reader.next())
res = {"Filename": obj, "Count": col_count}
result.append(res)
return result
评论列表
文章目录