Commit d760888d authored by Franziska Koehn's avatar Franziska Koehn
Browse files

filtered empty strings

parent 469f5b79
......@@ -22,8 +22,12 @@ def count_substrings(substrings, strings):
if strings == []:
return []
subs = list(set(substrings))
results = defaultdict(int)
for sub,string in product(substrings, strings):
for sub,string in product(subs, strings):
if sub == '':
results[sub] # create key
if sub.lower() in string.lower():
results[sub] += 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment