Delete generator.py

This commit is contained in:
Isaacdelly
2019-02-04 14:29:42 -08:00
committed by GitHub
parent d4b0ef2aa3
commit 966dbd1ece

View File

@@ -1,29 +0,0 @@
import csv
import bloom_filter
import pickle
print('reading csv file into set')
temp = set()
with open('database.csv') as file:
reader = csv.reader(file)
for row in reader:
try:
if row[0]:
temp.add(row[0])
except IndexError:
continue
print('set -> BF')
filter = bloom_filter.BloomFilter(max_elements=len(temp), error_rate=0.0000001)
for i in temp:
filter.add(i)
print('serializing BF')
with open('database.pickle', 'wb') as handle:
pickle.dump(filter, handle, protocol=pickle.HIGHEST_PROTOCOL)
print('testing')
with open('database.pickle', 'rb') as handle:
t = pickle.load(handle)
print("TEST: " + str(t == filter))