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

filtered empty strings

parent 151f3ea0
......@@ -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 == '':
continue
results[sub] # create key
if sub.lower() in string.lower():
results[sub] += 1
......
Supports Markdown
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