tests.py 389 Bytes
Newer Older
Sanjay Krishnan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
from hyperloglog import HyperLogLog
from core import imdb_years
from collections import Counter

def main_test():

    y = HyperLogLog(b = 4)
    z = Counter()

    for i, w in enumerate(imdb_years()):
        y.update(w.encode('utf-8'))
        z[w] += 1
        
    print("Implemented: {}\nTrue count: {}".format(y.count(), len(z)))
        
if __name__ == "__main__":
    main_test()